skka3134

skka3134

email
telegram

Developing a simple blockchain using Rust.

A simple structure of a blockchain can be understood as countless blocks connected together like a chain to form a blockchain.
image

image
The green part is called the block header, which includes (pre hash, tx hash, time).
The black part and the blue part are called the block body, which includes (hash, transaction).

The pre hash is the hash of the previous block.
Time represents the transaction time, a timestamp.
The tx hash is used to ensure that the data is not tampered with. The data of each block can theoretically be tampered with, but the hash will not match after the change.
Transaction refers to transaction information.
Finally, there is the hash value of the entire block, which is equivalent to the identifier of each block. Similarly, as long as a piece of data in the block is changed, the hash value will change.

Code above!

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.