科技隨筆
科技隨筆

| 科技閱讀 | 程式語言 | 理財規劃 | 工具推薦 | 音樂盛宴 | 生活雜談 | 科技隨筆中,不只有科技! 在這裡,我會隨筆記下科技閱讀、程式語言、理財規劃、音樂饗宴以及生活雜談等等內容。 邀請您在過程中與我一同分享也一同成長。 讓我們在人生的旅途中不斷學習,努力成為更棒的人吧~ 在其他平臺關注我: https://linkby.tw/itechnote.co

[Blockchain knowledge] Expensive blockchain chat room? !

This article will let you understand how to use the blockchain to transmit text, and will also mention how the computer transmits and recognizes human language, and finally takes you to send a transaction, and insert a hexadecimal text into the transaction as a Input data is stored on the chain, so that everyone can see and try to decode it and restore it to a language that humans can understand.

Wintermute loses 20 million OP tokens and regains it

Recently, I have been paying more attention to the development of Ethereum L2, including news such as the issuance of OP tokens by Optimism, and a very miraculous thing happened about a month ago. I will not talk about the process. It is not the topic of this article. Take a look at the news at the time and the explanations of the subsequent great gods.

In short, Wintermute was stolen by attackers with 20 million OP tokens. About a few days later, the attackers sent a transaction to Vitalik, the co-founder of Ethereum, and hid something under the chain. The URL for the transaction data is: https://optimistic.etherscan.io/tx/0x48464e4a6459062ac07efb4959fe8a6f90843f74922e68f71a929b33969f8f37

Pull down and click on "Click to see More" and switch the View Input As under the input data string of garbled characters from Default to UTF-8, and you will see a sentence emerge! To the effect that the attacker who took the tokens sent one million OP tokens and messages, ask Vitalik to help verify the address, and he will return another 18 million OP tokens (19 million in total) to Wintermute.

That's when I thought, yeah! In the past, when we were doing transfers or interacting with smart contracts, everything seemed so reasonable and passed, but after each transaction, you can put some strings that are converted into binary data, so that you can Are you chatting on the blockchain? (Very expensive chat room?!)

Can a computer read text? What is Binary data?

Have you ever wondered how computers recognize the Chinese, English and symbols we write?

In fact, the computer only recognizes 0 or 1 and cannot understand human language. If the computer needs to recognize these text symbols, it needs to do a conversion to convert these contents into a binary data for storage. This data is called Binary data.

This conversion is also easy to understand. People define a large table to specify which number represents which symbol. In terms of the more common and simple ASCII Code, A can be converted to 65, B is 66, and a is 97 , b is 98..., 0 1 converted to binary is A = 1000001, B = 1000010 and so on.

Since these hash functions on the blockchain are more hexadecimal, like our wallet address is also a hexadecimal value (only 0~F values will appear), so suppose you want to send "Hello world" to On the other hand, according to the ASCII code comparison table, we can get a set of hexadecimal "0x48656c6c6f20776f726c64".

Send text messages on Ethereum

The encoding used by Ethereum is UTF-8, which is evolved from ASCII Code, so English capitalization and basic symbols are compatible with ASCII encoding, but UTF-8 can store more digits, and most of the words in different languages in the world Corresponding codes can be found.

Using Metamask on the browser can achieve text transmission, but we need to open the hexadecimal data first, click "Settings" → "Advanced" → "Enable Display Hexadecimal Data" to complete the initial setting.

Next, we need to convert the value to be input into the hexadecimal value corresponding to UTF-8, and send this content during the transaction, and the other party can convert it back to human language and symbols through this set of hexadecimal Input data.

In addition to English, UTF-8 also supports Chinese characters, so as long as you search for the keyword "String to UTF-8" on the Internet, you should be able to find some online converters that can be used directly.

The next step is to execute a transaction normally. The amount of the transaction can be set to 0, and after converting the text to be transmitted to UTF-8, add 0x in front and fill in the "hexadecimal data".

In the example here, I intend to fill in "hello world!". After transcoding, it is "68656c6c6f20776f726c6421", and adding 0x in front becomes "0x68656c6c6f20776f726c6421".

(The diagram at the bottom is missing a 6. It was corrected before transmission but I forgot to take a screenshot again. I was lazy and decided to use it directly haha)

After sending, it will take a while to upload to the chain. Go to the browser corresponding to the blockchain you are using to query your wallet address. Ethereum is etherscan, Polygon is polygonscan, and testnet is the scan corresponding to Testnet.

After finding the transaction record just now, pull down and click "Click to see More" and switch the View Input As under the input data string of garbled characters from Default to UTF-8, and you will see the string "hello world! "Oh!

So this way, the blockchain can be used as an expensive chat room, but I think the average person should not want to use it like this...

The possible use that I think of at the moment is probably to pass some public content that I don’t want to be tampered with... For example, a candidate’s political opinion is published on the blockchain, and everyone sees it as a result if the vote is bounced, it will become permanent on the blockchain. joke.

Or can it be used to verify that the wallet address belongs to someone? Many people say that they are Satoshi Nakamoto, but it is actually very simple to prove whether he is himself or not. It can be proved by asking him to send any on-chain message to a certain wallet address.

If you have any other application scenarios in mind about the blockchain chat room, please leave a message below to discuss with me.

In addition, when I was thinking about the blockchain chat room, I suddenly realized that the ledger and extension services provided by the entire blockchain should also be regarded as a cloud service! ! ! But this seems to be another issue.


Finally, thank you for taking the time out of your busy schedule to read my articles. If you still like these content, I hope to get your follow-up and small sponsorship support, which will give me more motivation to continue writing. EVM compatible wallet The address is 0xae1dd06d57f582999a9c50b86ba913eecd7155ce.

Also welcome to join the Line community or Telegram group to discuss related topics

See you next time o((>ω< ))o~

Original link ITechNote technology essay

CC BY-NC-ND 2.0

Like my work?
Don't forget to support or like, so I know you are with me..

Loading...

Comment