Basic data structure in blockchain

transaction data structure

1 input: Initiator A's address

2 outputs: transfer 1 coin to B, A has 1 coin left 

block data structure

Blockchain is a linked list composed of multiple blocks, each block contains block header and block body,

The block header contains 1. The hash pointer of the previous block 2. The root hash of the block body 3. The timestamp

The block body contains 1. Hash tree leaf node records detailed transaction records Non-leaf node records hash addresses. 

The complete process of the transaction

First, A uses his own private key to generate a signature for the transaction, and broadcast

Then other nodes will verify it after receiving it, and if it is legally added to their own transaction pool

Then the bookkeeping node packs the transaction, packs it into a new block and broadcasts it

Finally, each node updates the local ledger after receiving it. 

Guess you like

Origin blog.csdn.net/qq_29857681/article/details/125870101