Skip to main content
. 2023 Feb 10;23(4):2000. doi: 10.3390/s23042000
Algorithm 2 Cross-chain data circulation with access control and identity authentication (I: improvement point)
  • 1:

    Input:

  • 2:

       CHAINS: the set of chains in the cross-chain system

  • 3:

       AG: the set of auto agents

  • 4:

       AGRobot: the set of AGRobots

  • 5:

       CrossCon: the set of cross-chain contracts

  • 6:

    Output:

  • 7:

       True or False

  • 8:

    ————————————————————————————————————————

  • 9:

    1. Propose (ui from ACi to ACj):

  • 10:

       FromChainIDChainIDi

  • 11:

       ToChainIDChainIDj

  • 12:

       Authenticate ui in ACi                         ▹I

  • 13:

       txiCrossConi(FromChainID,ToChainID,Options)

  • 14:

       Broadcast txi in ACi

  • 15:

       invoke (Cross-chain broadcast)

  • 16:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - – - - - - - - - - - - - - - - - - - - -

  • 17:

    2. Cross-chain broadcast:

  • 18:

       AGi receives txi

  • 19:

       if FromChainIDToChainID then

  • 20:

          SigAGiSKAGi(ToChainID)                   ▹I

  • 21:

          ACIACs(FromChainID,ToChainID,SigAGi)         ▹I

  • 22:

          if PKAGi(SigAGi)ToChainID then                ▹I

  • 23:

             txsAGRobot(txi)

  • 24:

             Broadcast txs in SC

  • 25:

             invoke (Response)

  • 26:

          else                                  ▹I

  • 27:

             Return False                               ▹I

  • 28:

       else

  • 29:

          Broadcast txi in ACi

  • 30:

          Return False

  • 31:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - – - - - - - - - - - - - - - - - - - - -

  • 32:

    3. Response (AGk receives txs):

  • 33:

       if ToChainID=ChainIDk then

  • 34:

          SigAGjSKAGj(FromChainID)                   ▹I

  • 35:

          ACIACs(FromChainID,ToChainID,SigAGj)          ▹I

  • 36:

          if PKAGj(SigAGj)FromChainID then                ▹I

  • 37:

             txkAGRobot(txs)

  • 38:

             Broadcast txk in ACk

  • 39:

          else

  • 40:

             Return False                              ▹I

  • 41:

          CrossConk(FromChainID,ToChainID,Options)

  • 42:

          Return True

  • 43:

       else

  • 44:

          Broadcast txs in SC

  • 45:

          Return False