"Remember" is the best farewell. How to use blockchain to store information on the chain?

Source: Chained

Dr. Li Wenliang was unfortunately killed by new crown pneumonia in the early morning of the 7th. His premature death has made us very sad.

In December last year, people's understanding of new coronary pneumonia was still very limited. Li Wenliang was able to spread the news and take the lead in sounding alarms among professionals. This is part of his highly professional performance. In later recounts, it was found that he showed respectable medical ethics in his usual work.

The World Health Organization has tweeted today expressing sorrow over the death of Dr. Li Wenliang. Tweet: All of us should praise him for his work on the new coronavirus epidemic.

Someone has built a monument for Dr. Li Wenliang on the Ethereum blockchain, the contract address is

0x6E46D3AB7335FFFB0d14927e0B418CC08fe60505

Block height 9432824. The deeds of Dr. Li Wenliang will always be engraved on the blockchain and cannot be tampered with or deleted.

Anyone who wants to see this monument can visit etherscan.io to search for the contract address. This is a website for viewing Ethereum transactions and contracts.

As a distributed ledger system, Ethereum records transaction information. How is this information recorded?

We know that Ethereum packages transaction data and verification information in a block at regular intervals, and concatenate them in turn to form a chain. This block number is called the block height. The block header (verification information) of each block stores the block header hash value (ParentHash, parent block hash) of the previous block. In this way, the blocks in the blockchain are linked to each other. If we change the content of a block in the front, the hash of the parent block of the subsequent block does not correspond to it, and such a block cannot be consensus. This ensures that the blockchain data cannot be tampered with.

Saving data on the Ethereum blockchain is mainly achieved by additional data in transactions or by deploying smart contracts.

Additional data

In simple terms, each block of Ethereum is divided into two parts. The first is a block header that contains information such as the hash value and time stamp of the parent block. The block header also contains:

ParentHash: the hash of the parent block

Number: block number

Timestamp: timestamp generated by the block

GasUsed: Gas consumed by the transaction

GasLimit: Gas limit

Difficulty: difficulty of POW

Beneficiary: Beneficiary of block packing fees, also known as miners

Nonce: a random number that makes the block header hash meet the requirements of POW

As the block header is produced, the block also contains transaction, status, and receipt information.

The transaction information includes:

Type: The type of transaction

Nonce: the transaction count of the sending address

Value: the amount sent to the target account

ReceiveAddress: recipient address

GasPrice: Gas price paid for the transaction

Gas: Gas paid for the transaction

Data: Additional data for the transaction

VRS: Transaction Signature Structure The Data column contains the information that the user wants to record in the ETH block. This transaction data field was originally used to describe the transaction description, but because it does not occupy Gas, that is, it does not generate any fees, it has become a field for recording content.

According to the characteristics of the blockchain itself, each transaction has a unique ID. With this ID, we can view all historical transactions, including everything mentioned above: transaction type, timestamp, Gas, additional data, etc. Once we know this ID, we can look at the information contained in the block.

for example,

0x802a072a303a1bb19a20065a262526f2cfda0d1ea16eeb3db6500d9d06f65963

By changing the additional data in this transaction to UTF-8 encoding, you can see an article about vaccine quality.

Deploying smart contracts

The smart contract can be simply understood as an executable program fragment. The specific code is written by the publisher using a specific programming language (Ethereum uses the Solidity programming language, similar to JavaScript). Once the coding is completed, the smart contract is Uploaded to the blockchain network, that is, the entire network of verification nodes will receive your smart contract. The Ethereum smart contract can also be understood as a special transaction (including executable code). After being sent out, it will be packaged and recorded by a miner in a certain block. When the smart contract needs to be called, only the smart Send a transaction at the address of the contract. The community-built monument for Dr. Li Wenliang is also preserved in this way.

Another example is at the contract address

0xdc7c743110Ec689d82f050302319AE27aF84f8fa

You can see the Korean version of the famous Panmunjom Declaration. The transaction was recorded in 2018 by Ryu Gi-hyeok, a South Korean developer.

How do I save my information?

If you are an ordinary user who does not understand programming, you can download the MetaMask browser plug-in, make any transaction on the Ethereum mainnet, and convert the information you want to save into a hex code and paste it in the transaction data column. It should be noted that this process requires you to pay some GAS (ie, handling fees).

If you understand the Solidity programming language used by Ethereum, you can attach the content to the code, deploy it on the Ethereum mainnet and make any transaction to save your information on Ethereum.

We will continue to update Blocking; if you have any questions or suggestions, please contact us!

Share:

Was this article helpful?

93 out of 132 found this helpful

Discover more

Blockchain

The exchange is robbing the tokens, all of which are behind the interests.

Since 2019, with the launch of the first issue of the currency-raising (IEO), the “project-side tokens have be...

Blockchain

From Caroline Ellison to Gary Wang The Fate of Bankman-Fried Hangs by a Thread, According to Bloomberg

Three ex-close friends and colleagues of FTX co-founder Sam Bankman-Fried have testified against him, possibly result...

Blockchain

The cryptocurrency exchange "closed tide", running to catch up with P2P

The cryptocurrency exchange, once regarded as “stable and not paying”, is more crazy than other fields,...

Blockchain

Deep Dive into Uniswap V4: A "Masterpiece" of Decentralized Exchange

Updates to Uniswap V4 could further enhance its position in the DEX space, with the "hooks" feature greatly improving...

Blockchain

Coinbase becomes Tezos' largest verification node, will it be a new trend for exchanges?

Original: Cryptopotato , original author: Jordan Lyanchev Source: Odaily Planet Daily, Translator: Yu Shunsui Accordi...

Market

Wu said Zhou's selection Hong Kong regulatory agency opens retail trading, Curve hacked, Binance US Department of Justice progress and news Top10 (0729-0805)

Author | Wu's Top 10 Blockchain News of the Week. The Hong Kong Securities and Futures Commission has approved the li...