市值: $2.8867T -1.790%
體積(24小時): $105.2327B -22.390%
  • 市值: $2.8867T -1.790%
  • 體積(24小時): $105.2327B -22.390%
  • 恐懼與貪婪指數:
  • 市值: $2.8867T -1.790%
加密
主題
加密植物
資訊
加密術
影片
頭號新聞
加密
主題
加密植物
資訊
加密術
影片
bitcoin
bitcoin

$93215.179206 USD

0.38%

ethereum
ethereum

$1786.943555 USD

0.06%

tether
tether

$1.000175 USD

0.00%

xrp
xrp

$2.203069 USD

-0.65%

bnb
bnb

$605.391706 USD

-1.23%

solana
solana

$149.256425 USD

0.61%

usd-coin
usd-coin

$0.999535 USD

-0.03%

dogecoin
dogecoin

$0.174954 USD

-3.17%

cardano
cardano

$0.688461 USD

0.13%

tron
tron

$0.244971 USD

-1.16%

sui
sui

$3.000916 USD

9.45%

chainlink
chainlink

$14.767585 USD

3.50%

avalanche
avalanche

$22.085304 USD

-0.60%

unus-sed-leo
unus-sed-leo

$9.165805 USD

1.11%

stellar
stellar

$0.263078 USD

-1.40%

加密貨幣新聞文章

使用op_return將消息留在比特幣區塊鏈上

2025/04/24 09:11

近年來,在各種安全事件中經常使用鏈上的鍊鍊信息作為區塊鏈世界中一種特殊的通信方法。

使用op_return將消息留在比特幣區塊鏈上

Author:Lisa

作者:麗莎

Editor: Sherry

編輯:雪利酒

Recently, blockchain security incidents have frequently occurred, and attackers often leave messages on-chain to communicate with the victims or the white hat team. On-chain messages, as a special communication method in the blockchain world, have been used in various security incidents in recent years. For example, SlowMist recently assisted KiloEx in conducting multiple rounds of communication with the attacker through on-chain messages, and finally successfully facilitated the return of all stolen funds of US$8.44 million. In an anonymous environment, on-chain messages can be used as an effective tool to establish initial dialogues and lay the foundation for subsequent fund recovery.

最近,區塊鏈安全事件經常發生,攻擊者經常在鏈上留言,與受害者或白帽團隊進行交流。近年來,在各種安全事件中使用了鍊鍊消息,作為區塊鏈世界中的一種特殊通信方法。例如,Slowmist最近通過鏈消息協助Kiloex與攻擊者進行了多輪溝通,並最終成功地促進了所有被盜資金844萬美元的資金。在匿名環境中,鏈上消息可以用作建立初始對話並為後續基金恢復奠定基礎的有效工具。

In our previous article "First aid guide for stolen funds: On-chain messages", we introduced in detail the message method on Ethereum. The Bitcoin network also supports on-chain messages, but the implementation methods of the two are slightly different. The core tool for Bitcoin on-chain messages is the OP_RETURN instruction. It allows users to embed 80 bytes of custom data in transactions. This part of data will not be used by nodes for transaction verification, nor will it affect the status of UTXO. It is purely used to record information and will be fully recorded in the blockchain.

在上一篇文章“被盜資金的急救指南:鍊鍊消息”中,我們詳細介紹了以太坊的消息方法。比特幣網絡還支持鏈上消息,但是兩者的實現方法略有不同。比特幣上鍊消息的核心工具是OP_Return指令。它允許用戶在交易中嵌入80個字節的自定義數據。節點不會使用該部分數據來進行交易驗證,也不會影響UTXO的狀態。它純粹用於記錄信息,並將完全記錄在區塊鏈中。

How to use OP_RETURN to leave messages on the chain

如何使用op_return將消息留在鏈上

Step 1: Encode the message content

步驟1:編碼消息內容

First, convert the text information to be sent into hexadecimal (HEX) format. The OP_RETURN instruction on the Bitcoin chain only accepts HEX format data.

首先,將文本信息轉換為發送到十六進制(十六進制)格式。比特幣鏈上的OP_Return指令僅接受HEX格式數據。

For example, if you want to leave a message:

例如,如果您想留言:

This is a test.

這是一個測試。

The converted HEX is:

轉換後的十六進制是:

54686973206973206120746573742e

54686973206973206120746573742E

This can be done using an online format conversion tool or via a Python script:

可以使用在線格式轉換工具或通過Python腳本完成此操作:

text = "Hello, this is a test."hex_text = text.encode("utf-8").hex()print(hex_text)

text =“你好,這是一個測試。” hex_text = text.encode(“ utf-8”)。 hex()print(hex_text)

The message content must be less than 160 hexadecimal characters, or 80 bytes. If the length exceeds this limit, it is recommended to simplify the message or send it in multiple messages.

消息內容必須小於160個十六進製字符或80個字節。如果長度超過此限制,建議簡化消息或將其發送到多個消息中。

Step 2: Construct a transaction with OP_RETURN

步驟2:使用op_return構建交易

Next, you need to use a Bitcoin wallet or tool that supports custom transactions to create a transaction with an OP_RETURN output.

接下來,您需要使用支持自定義交易的比特幣錢包或工具,以創建使用OP_Return輸出的交易。

Taking Bitcoin Core as an example, use createrawtransaction to manually add OP_RETURN output:

以比特幣核心為例,使用CreaterawTransaction手動添加OP_Return輸出:

bitcoin-cli createrawtransaction '[{"txid":"your_input_txid","vout":0}]' '[{"data":"54686973206973206120746573742e"}]'

比特幣-CLI createrawtransaction'[{“ txid”:“ your_input_txid”,“ vout”:0}]''[{“ data”:“ 54686869732069732061207465746573742E”}

The transaction constructed in this way will not actually transfer the money, but will only write the message on the chain.

以這種方式構建的交易實際上不會轉移錢,而只會在鏈條上寫下消息。

Take the imToken wallet as an example. Enter the BTC wallet transfer interface and turn on "Advanced Mode". Enter the hexadecimal information in the "OP_RETURN" input box. Click "Next" to complete the transaction information confirmation. Enter the transaction password to successfully send the transaction with OP_RETURN information. Please make sure that "Input amount = Output amount + Miner's fee".

以Imtoken錢包為例。輸入BTC錢包傳輸接口,然後打開“高級模式”。在“ OP_Return”輸入框中輸入十六進制信息。單擊“下一步”以完成交易信息確認。輸入交易密碼,以成功地發送交易,並使用op_return信息。請確保“輸入金額=輸出金額 +礦工的費用”。

Step 3: Broadcast the transaction

步驟3:廣播交易

The signed transaction is broadcasted through the Bitcoin network. Since OP_RETURN transactions do not actually transfer funds, they must include mining fees to be processed and wait for miners to pack them into blocks. Once the transaction is confirmed, the message will be permanently stored in the Bitcoin blockchain.

簽名交易是通過比特幣網絡廣播的。由於OP_Return Transactions實際上並未轉移資金,因此必須包括進行處理的採礦費,並等待礦工將其包裝成塊。一旦確認交易,該消息將永久存儲在比特幣區塊鏈中。

Step 4: View the message content

步驟4:查看消息內容

After completing the transaction, you will get a TXID, which can be viewed through the block browser. The browser will usually automatically decode the OP_RETURN hexadecimal data back to ASCII, for example:

完成交易後,您將獲得一個TXID,可以通過塊瀏覽器查看。瀏覽器通常會自動將OP_Return十六進制數據解碼回ASCII,例如:

When this user posted these warnings, he did not just leave a message, but also burned a large amount of Bitcoin. Due to the characteristics of OP_RETURN output, any Bitcoin sent to such transactions will be burned and cannot be used. According to statistics, this user burned more than $300,000 worth of Bitcoin in this series of operations.

當該用戶發布這些警告時,他不僅留言了消息,而且還燒毀了大量比特幣。由於OP_Return輸出的特性,將燃燒到此類交易的任何比特幣都將被燒毀,無法使用。根據統計數據,該用戶在這一系列的操作中燃燒了價值超過300,000美元的比特幣。

Summarize

總結

On-chain messages, especially OP_RETURN in the Bitcoin network, provide an anonymous, public and tamper-proof communication method, which is frequently used in the initial contact and information transmission of fund recovery. However, it should be noted that on-chain messages may also be used by attackers to guide victims to visit malicious links or perform risky operations (such as entering private key decryption, etc.), so be sure to remain vigilant and avoid viewing and processing suspicious information on untrusted devices. When encountering a security incident, it is recommended to contact a professional security team as soon as possible to assist in analysis and improve the success rate of fund recovery. At the same time, users and project parties should

鏈上消息,尤其是比特幣網絡中的OP_Return,提供了一種匿名,公共和防篡改的通信方法,該方法經常用於基金回收的初始聯繫和信息傳輸。但是,應該指出的是,攻擊者還可以使用鍊鍊消息來指導受害者訪問惡意鏈接或執行風險操作(例如輸入私鑰解密等),因此請務必保持警惕,避免在不受歡迎的設備上查看和處理可疑信息。遇到安全事件時,建議盡快與專業安全團隊聯繫,以協助分析和提高基金恢復的成功率。同時,用戶和項目各方應

免責聲明:info@kdj.com

所提供的資訊並非交易建議。 kDJ.com對任何基於本文提供的資訊進行的投資不承擔任何責任。加密貨幣波動性較大,建議您充分研究後謹慎投資!

如果您認為本網站使用的內容侵犯了您的版權,請立即聯絡我們(info@kdj.com),我們將及時刪除。

2025年04月24日 其他文章發表於