Audit and Test Batching of TXOut Array.

The startBlock method creates a new (empty) TXOut object with the new STATECHAIN-BLOCKHEIGHT.

The statechain processes everything it is told and generates state change, as well as outgoing transactions. Each new outgoing transaction (from an incoming transaction) is appended into the TXOut.

{“TXArrayID” : STATECHAIN-BLOCKHEIGHT,
 "hash" : "",
 "txArray" : [{ “to” : "USERAaddr"
	         “Amount”: "200000000"
		“Token”: "BNB"},
               { “to” : "USERBaddr"
	         “Amount”: "200000000"
		“Token”: "RUNE-A1F"}
}
  • The TXArrayID is the statechain block height.
  • The hash will be empty
  • The txArray has all the outgoing transactions.

The Signer queries this on a cycle, to find new, unsigned TXArrays. It will receive a TXArray to construct the message payload to sign:

https://docs.binance.org/encoding.html

{
   "sequence" : "64",
   "account_number" : "12",
   "data" : null,
   "chain_id" : "chain-bnb",
   "memo" : "STATECHAIN-BLOCKHEIGHT",
   "msgs" : [
      {
         "inputs" : [
            {
               "coins" : [
                  {
                     "denom" : "BNB",
                     "amount" : "200000000"
                  }, 
                  {
                     "denom" : "RUNE-A1F",
                     "amount" : "200000000"
                  }
               ],
               "address" : "POOLADDRESS"
            }
         ],
         "outputs" : [
            {
               "address" : "USERAaddr",
               "coins" : [
                  {
                     "denom" : "BNB",
                     "amount" : "200000000"
                  }
               ]
            }, 
            {
               "address" : "USERBaddr",
               "coins" : [
                  {
                     "denom" : "RUNE-A1F",
                     "amount" : "200000000"
                  }
               ]
            }
         ]
      }
   ],
   "source" : "1"
}

When the signer gets a commitment hash from Binance chain, it will set this back in the STateChain for that TXArrayID.

Edited Aug 08, 2019 by JP
Assignee Loading
Time tracking Loading