btcsuite / btcd

An alternative full node bitcoin implementation written in Go (golang)
https://github.com/btcsuite/btcd/blob/master/README.md
ISC License
6.2k stars 2.36k forks source link

Bitcoin ordinal inscription encode script with small number #1965

Open ee07b415 opened 1 year ago

ee07b415 commented 1 year ago

From the bitcoin ordinal code example: https://github.com/casey/ord/blob/938b5cc97d48d026fd9250eae661d1e87286b377/src/inscription.rs#L439 we will need to push []byte{1} as a mark for contentType for bitcoin inscription, but current script builder AddData will convert this into small number OPcode AddData So in the encode string, instead of 0101(data length 1, data 1) the builder will encode this into 0x51(OP_01)

I'm not sure if we will support the bitcoin ordinal inscription in the future, a push_exact_data would be preferred here