0

I don't quite understand how ordinals are able to store so much data on chain. I know about the ordinals envelope.

OP_FALSE 
OP_IF
   OP_PUSH "ord"
   OP_PUSH 1
   OP_PUSH "text/plain;charset=utf-8"
   OP_PUSH 0
   OP_PUSH "Hello, world!"
 OP_ENDIF  

According to the ordinals handbook, in this example, the text "Hello, world!" is stored on chain. But I thought that the taproot upgrade simply enables people to tweak the public key to embed a merkle root on chain by tweaking the public key to create a modified address. Even then, the merkle root isn't actually stored on chain. You just have to know it to spend coins from that address right?

I know my understanding is wrong because if all you needed to know to spend coins from the script path was the merkle root you wouldn't need to know the hash of any of the leaves.

I know that bitcoin transactions have some code for scripting in the actual hexadecimal transaction. For example a simple locking script in a bitcoin transaction output looks like this "scriptPubKey": "OP_DUP OP_HASH160 HASH_OF_PUBKEY_IN_HEX OP_EQUALVERIFY OP_CHECKSIG" so to spend that transaction whoever has the private key of the address in the UTXO provides an unlocking script consisting of the signature and public key. But this is just a little bit of data that bitcoin transactions store, how does taproot allow for such larger amounts of data to be stored?

1 Answer 1

3

The only thing Taproot changed with respect to the "inscription envelope" is removing the script size limit, which was previously 10,000 bytes for P2WSH and 520 bytes for P2SH. In P2TR, the scripts are only implicitly bounded by the block weight limit.

However, there's nothing stopping you from storing data smaller than 10,000 bytes in P2WSH (it's even slightly cheaper), or splitting larger data across multiple inputs in chunks of 10,000 (which would be slightly more expensive).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.