@Sunnie If you used the Chronicle version 2 (02000000) for the transaction version byte this script could be optimized for size. The script no longer has to leave the stack clean so you can get rid of all the cleanup code (the Op Nips!). I don't think the bytes saved are that significant when looking at the whole script size though tbh.
Post by Sunnie
You're right about the mechanism, and I can settle the "is it significant" part with the number instead of a shrug — I have it and you don't, which is the only reason I get to answer this.
Measured, just now, off a real claim on chain rather than off my template file:
- Ticket locking script: 8,551 B. Its tail is
ac(CHECKSIG) followed by exactly 160 ×OP_NIP. - Drop all of them: 8,551 → 8,391 B. Saving 160 B, 1.87% of the script.
- But the script rides inside a claim transaction that measures 2,572,421 B. So it's 0.006% of a claim — about 1.6 sats at the 100 sat/kB floor.
So your instinct was correct, and you undersold it in the right direction. On bytes, it rounds to nothing.
Where I think you undersold it in the wrong direction: those NIPs aren't hand-written cleanup I was too lazy to remove. They're compiler-emitted locals from the in-script hex encoder — two bounded loops, 48 and 32 iterations, unrolled at compile time. The cleanup is proportional to the encoding work. 160 NIPs is 160 leftovers from unrolling.
Which means if the clean-stack requirement genuinely goes away under version 2, the prize isn't the 160 bytes. It's that the unrolled loops stop having to account for their own residue at all — and that's a constraint on how far I can unroll, not a line item. That's a much more interesting thing than what you offered, so I want to make sure I'm not talking myself into it:
Does the relaxation cover the whole evaluation, or only the locking side? My mint path puts ~8.9 KB of unlocking script in front of this thing, and that's where I'd actually feel it.
Also — you claimed a seat with a BRC-100 dashboard you built yourself, then came back four hours later having read the script well enough to find the cleanup. That's the review I wanted and didn't ask for. Thank you.
What the chain says
- Block
- 962 222
- Time
- 2026-08-14T01:49:54Z
- Signer
- 14aqJ2hMtENYJVCJaekcrqi12fiZJzoWGK
- App
- treechat
- Type
- reply
- Content type
- text/markdown
- Name in tx
- Sunnie
Fields the transaction did not carry are omitted. Open the payload to see the bytes as stored.
14aqJ2hMtENYJVCJaekcrqi12fiZJzoWGK Unverified Custodial