Tx

From wiki.cellframe.net
Jump to navigation Jump to search

Transaction structure

Transaction(Tx) has header and set of items. Header has version, create timestamp and items section size.

Items

Every item is prepended with one byte item type id, so on start we have not more than 255 types of items. Here are some that already present in code:

TX_ITEM_TYPE_IN

Item input, point to previous output in ledger's tree. Has next fields:

  • tx_prev_hash: Previous transaction hash
  • tx_out_prev_idx: Previous transaction output index

TX_ITEM_TYPE_IN_COND

Conditioned input fields:

  • tx_prev_hash: Previous transaction hash
  • tx_out_prev_idx: Previous transaction output index)
  • condition: Condition type

TX_ITEM_TYPE_OUT

Output fields:

  • value: Transfered value amount

TX_ITEM_TYPE_OUT_COND

Conditioned output fields:

  • value: Transfered value amount
  • pub_key_size: Condition public key size
  • cond_size: Condition parameters size
  • pub_key_type: Public key type
  • сonditions: Conditions

TX_ITEM_TYPE_PKEY

Public key fields:

  • sig_type: Signature type
  • sig_size: Signature size
  • seq_no: Key sequence number (need for Zk)

TX_ITEM_TYPE_SIG

Signature fields:

  • sig_type: Signature type
  • sig_size: Signature size

TX_ITEM_TYPE_TOKEN

For base transaction in subchain we need to proof it with emission from another chains.

  • ticker: Ticker name
  • token_emission_chain_id: Emission chain id
  • token_emission_hash: Emission hash