4

Doom was inscribed on chain. The reveal transaction had the following script

OP_PUSHBYTES_32 1809cc80b0c9bf0277e774f7f78c5dd0c61f9eda7bec7875dc99457bbf61af8f
OP_CHECKSIG
OP_0
OP_IF
OP_PUSHBYTES_3 6582895
OP_PUSHBYTES_1 1
OP_PUSHBYTES_23 746578742f68746d6c3b636861727365743d7574662d38
OP_0
OP_PUSHDATA2 520 3c21444f43545950452068746d6c3e3c68746d6c3e3c686561643e3c7469746c653e59657420416e6f74686572
...
OP_PUSHBYTES_73 682e73696e2c4b3d4d6174682e636f732c6b3d4d6174682e50492c71693d4d6174682e72616e646f6d2c573d4d6174682e6162732c45693d4d6174682e6d61783c2f7363726970743e
OP_ENDIF

Can someone provide an insight into the byte structure of the raw witness data (see picture below)? What's in the "header" 0e9713..d0? Why are there two copies of hash 1809cc80..af8f? Is there some online resource which could help me understand this better (besides bips)?

raw witness data?

2 Answers 2

1

A taproot script path spend always has at least 2 witness items:

  • The second-to-last item is the leaf script.
  • The last item is the "control block" which consists of a leaf version, the taproot internal key (the public key before it was tweaked with the merkle root of the script tree) and optionally any merkle branches that prove the inclusion of the script in the tree. These are not present here because the tree only has one script (this might be required by the inscription standard, haven't checked).
  • Any remaining items are used as the initial stack for script execution. In this case the single remaining item is the signature that satisfies the OP_CHECKSIG opcode.

The public key 1809cc80..af8f is used both as an internal key and in the script. This would normally hurt privacy because you reveal that the key path has the same key as the script path, but in the case of inscriptions it doesn't really matter because you already reveal you weren't going to use the key path, and it probably simplifies the code a little.

1

I think Vojtěch Strnad answered your main questions, I just wanted to point out how the inscribed data is encoded:

You wrote:

OP_PUSHBYTES_32
1809cc80b0c9bf0277e774f7f78c5dd0c61f9eda7bec7875dc99457bbf61af8f
OP_CHECKSIG 
OP_0 
OP_IF 
OP_PUSHBYTES_3 6582895

Those three bytes are hex 6F7264 which is ASCII ord meaning the Ordinals project.

OP_PUSHBYTES_1 1
OP_PUSHBYTES_23 746578742f68746d6c3b636861727365743d7574662d38 

Those 23 bytes are text/html;charset=utf-8 - the type of data inscribed

OP_0
OP_PUSHDATA2 520
3c21444f43545950452068746d6c3e3c68746d6c3e3c686561643e3c7469746c653e59657420416e6f74686572

Those 520 bytes are HTML (as indicated previously):

<!DOCTYPE html><html><head><title>Yet Another Doom Clone</title></head><body><style>body{margin:0px;background:#000}#qQ{position:absolute;left:35vw;top:4em;font-size:2em;font-variant:small-caps;color:#aaa;animation:z 9s;}#cQ{height:100%;width:100%}#hQ{top:0px;width:10vw;height:2vh;border:3px solid #008;border-radius:3px;display:none}#fps{display:none}#hW{height:2vh;background:#00a}@keyframes q{50%{opacity:0}}.b{animation:q 1s linear infinite}@keyframes z{from{opacity:0}to{opacity:1}}</style><canvas id=cQ></canvas><Mdiv id=qQ><div id=hE>Yet Another Doom Clone<br><br><div class=b>Loading... <span id=jQ></span></div><br><br>Move: WASD<br>Aim/Shoot: Mouse/Click<br><br><br><br>By Nicholas Carlini</div><div id=hQ><div id=hW></div></div></div></body>

etc

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.