The genesis transaction for issuing tokens by Taproot Assets is to construct a Taproot transaction.
By Huang Shiliang
Let's think about something more advanced, how to use Taproot transactions to issue assets? This is the Taproot assets protocol.
This protocol is quite complex. Today, let's first understand it briefly, just to have an impression.
Assets, or tokens, if someone issues 100 numbers with a certain symbol and can ensure that no matter how these 100 things are transferred, everyone can be sure that these things come from the original 100 numbers, this is a successful asset issuance technology.
Taproot transactions (P2TR) were originally used to lock and spend bitcoins. P2TR can use n (1) scripts (i.e., a total of n scripts, any one can spend) to spend bitcoins. In P2TR transactions, all these n scripts are saved using a binary tree.
A binary tree is a very powerful algorithm that fills token information by writing some data in the leaf nodes of the binary tree. The entire algorithm can ensure that these tokens are non-falsifiable.
The world state of Ethereum uses a binary tree to save and update.
The genesis transaction for issuing tokens by Taproot assets is to construct a Taproot transaction, with the following unlocking conditions:
Private key signature unlocking, which is secondary for token issuance and should even be directly deleted, otherwise coins may be accidentally spent.
Script path unlocking. This script is a binary tree with 2^256 leaf nodes. In the genesis transaction, the following information is written in the first leaf node:
1) Token symbol, total amount, decimal point, etc.
2) Receiving address of the genesis coin, and then all other leaf nodes are empty (if the genesis transaction is sent to multiple addresses, it is also possible), and then the leaf nodes are hashed pairwise, the middle nodes are then hashed pairwise… all the way to the root node.
This root hash will be saved in the transaction data structure and eventually put on the chain. However, the entire binary tree will not be put on the chain.
The conditions for script path unlocking are the token receiving address signature and the submission of one's own leaf node's path in the entire binary tree.
When mining nodes verify the script path unlocking, they verify the signature and whether the calculated root of the submitted path matches the original saved root of the binary tree.
When transferring tokens, the address holding the tokens uses script path unlocking. When constructing the transaction, the input includes token information and one's own leaf node's path; the output includes the token receiving address and the change address, forming two new leaf nodes.
The transfer transaction involves deleting one (or more) leaf nodes and creating two (or more) new leaf nodes, then signing the entire transaction with one's own private key.
When miners receive token transfer transactions, they verify whether the calculated root of the input information matches the original one, and calculate a new root based on the output.
In this way, local assets can be issued on the Bitcoin chain, and these assets are securely verified by Bitcoin mining nodes.
More detailed technical details are too difficult, I can't explain them in a simple way. I will talk about it later.
免责声明:本文章仅代表作者个人观点,不代表本平台的立场和观点。本文章仅供信息分享,不构成对任何人的任何投资建议。用户与作者之间的任何争议,与本平台无关。如网页中刊载的文章或图片涉及侵权,请提供相关的权利证明和身份证明发送邮件到support@aicoin.com,本平台相关工作人员将会进行核查。