bitcoinjs-lib icon indicating copy to clipboard operation
bitcoinjs-lib copied to clipboard

Trying to understand how txOutputs as created

Open liammcaweeney opened this issue 2 years ago • 1 comments
trafficstars

Hey thanks in advance for any help.

How are the input UXTOs split into outputs?

Here is an example:

Bob is trying to buy an ordinal of Alice. Bob needs to pay Alice 0.1BTC for her ordinal and 0.01BTC for the network fee so bobs inputs total to 0.11 BTC. Alice's input is her ordinal which is has a UXTO value of 0.05BTC. So we know that the total input is 0.16BTC and the outputs are 0.1 BTC to Alice and 0.05BTC(ordinal?) to Bob and 0.01BTC to fee(miner).

What I don't understand is, how we can ensure that the UTXO containing the ordinal(any data) is not split or fractured when creating the outputs. I can see when creating a PSBT output we only specify the address and value so im not sure how we know 100% that the data is not fracture?

And further more looking at the outputs how can I check the data associated with it, ie this outout has the ordinal etc

liammcaweeney avatar Mar 23 '23 12:03 liammcaweeney

FYI I can see that its related to the ordering: https://docs.ordinals.com/faq.html#how-does-ordinal-theory-work

liammcaweeney avatar Mar 23 '23 12:03 liammcaweeney

@liammcaweeney When Bob purchases an ordinal, his transaction doesn't split the UTXO containing the data (whatever it may be). Instead, it consumes this UTXO whole and creates a new output specifically for it, sending it back to Bob's address with the same value. This guarantees the data stays bundled with the bitcoin. Bitcoin ordinals are a new development with potential benefits and drawbacks. This is a really interesting article about ordinals and the Bitcoin ecosystem -> https://substack.com/@jimmysong/note/c-52186116?r=25opgr

yemmyharry avatar Apr 23 '24 17:04 yemmyharry