On the blockchain of the UTXO model, assets can be compared to coins in wallets in the real world. Each coin is independent. Correspondingly, a person may hold many UTXOs at the same time, and each UTXO can Use a different key.

This poses a challenge to digital currency wallets, and it is no longer possible to transfer all of the user's assets by simply transferring a private key. We desperately need a new format to describe exactly a UTXO.

Taking Bitcoin as an example, we need the following information to spend a UTXO:

  1. previous_txid transaction that generated this UTXO
  2. previous_index The position of this UTXO
  3. lock_script the lock script for this UTXO
  4. unlock_script the script to unlock this UTXO

So if a UTXO is represented in json format, it can be like this:

 {
  "txid": "...",
  "index": 0,
  "lock": "...",
  "unlock": "..."
}

Some people say that merkle proof can also be added to this structure, so that combined with the Block Header service, it is possible to verify whether this UTXO is (once) on the chain.

But if it's just for transferring UTXO between different wallets, I think this is enough.


Ljzn
399 声望102 粉丝

网络安全;函数式编程;数字货币;人工智能