ordinals / ord

👁‍🗨 Rare and exotic sats
https://ordinals.com
Creative Commons Zero v1.0 Universal
3.85k stars 1.38k forks source link

Store inscriptions in taproot signature annex #2405

Open casey opened 1 year ago

casey commented 1 year ago

@joostjager noticed that we could store inscriptions in the taproot signature annex, instead of in the tapscript. This would be great, since it would allow us to avoid needing two transactions to inscribe, and would allow us to use a simpler encoding independent of bitcoin script.

Before doing this, we should wait for some carve-out for unstructured annex data. One such proposal makes annexes starting with a zero byte unstructured[0]. If we don't wait for this, and a future soft fork gives the annex consensus meaning, we'll probably have to change the format of annex inscriptions.

If we do this, we should come up with an alternative encoding for inscriptions, since using the script-based encoding in the annex doesn't make much sense.

[0] https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2023-June/021756.html

Related issues:

Psifour commented 1 year ago

I can confirm that the isStandard rule is the only reason our (Luxor's) inscription tooling on the backend uses multiple transactions still. Would love to reduce that and also remove the need for tooling as honestly an annex inscription become simple enough that I would trust the browser with constructing them.

Would 100% 'concept ack' that proposal.

ariard commented 10 months ago

This would be great, since it would allow us to avoid needing two transactions to inscribe,

Interesting if rough maths of block space usage compression gains at constant inscription demand. This might be one of the lowest hanging technical fruit to slow down on-chain fees growth, and make everyone happy. If no consensus on the policy change deployment, easy to do standalone patch and let the market speaks.

casey commented 10 months ago

@ariard Yeah, it would be a huge win. I'm thinking about creating a few patches and bundling them up in a branch:

ariard commented 9 months ago

Okay understanding the chain-space usage saving comes from eliminating the two-phase commit/reveal procedure.

By the way, while reading https://docs.ordinals.com/inscriptions.html (which I understood is best inscription spec available instead to look more in ord inner guts), I wonder if the default “hello world” example isn’t inefficient and OP_1 / OP_0 can be used to save few bytes (if stack binary is what is canonical for inscriptions apps not script ops).

By the way number 2, given the UTXO growth consumption surge arising from ordinals traffic over the past months (which is a real fucking issue), I wonder if ordinals format shouldn’t start to have some “utxo priority” marker. That way they could be cached in “spend likeliness” tiers by utreexo archive nodes. Still scaling inscriptions "on-chain" and maintaining some equilibrium for full-node operators.

edited - on max_standard_tx_weight both rule 3 / rule 5 can be abused for pinnings

casey commented 9 months ago

By the way, while reading https://docs.ordinals.com/inscriptions.html (which I understood is best inscription spec available instead to look more in ord inner guts), I wonder if the default “hello world” example isn’t inefficient and OP_1 / OP_0 can be used to save few bytes (if stack binary is what is canonical for inscriptions apps not script ops).

I think I have a branch open to do this, but we haven't gotten around to actually doing it #1403.