I’m having trouble finding good examples of this but what is the proper way of constructing an inscription Script for the commit transaction?
Using the bitcoin rust crate, this is how I assume the script should be constructed using “Hello World” as the example inscription content:
let inscription_script = Script::builder()
.push_opcode(OP_FALSE)
.push_opcode(OP_IF)
.push_slice(b"ord") // marker
.push_opcode(OP_PUSHBYTES_1) // protocol version (example)
.push_slice(b"text/plain;charset=utf-8")
.push_opcode(OP_0)
.push_slice(b"Hello World") // the payload bytes
.push_opcode(OP_ENDIF)
.into_script();
But the resulting ASM format of this Script looks way off from what I expected:
OP_0 OP_IF OP_PUSHBYTES_3 6f7264 OP_PUSHBYTES_1 18 OP_DEPTH OP_VERIF OP_OVER OP_DEPTH OP_PUSHBYTES_47 706c61696e3b636861727365743d7574662d38000b48656c6c6f20576f726c6468
Anyone have any good examples of constructing the leaf script for the commit transaction for inscriptions? Preferably using the bitcoin rust crate.









