Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What are the 2 new dummy outputs created for? #3

Open
jadwahab opened this issue Mar 26, 2023 · 3 comments
Open

What are the 2 new dummy outputs created for? #3

jadwahab opened this issue Mar 26, 2023 · 3 comments

Comments

@jadwahab
Copy link

Firstly, thanks for putting this together!

I'm just a little confused about what the 2 new dummy outputs created are for. I see the code says:
https://github.com/magiceden-oss/msigner/blob/3de81d4aaac4d030b2fb2967d704a59070981777/src/signer.ts#L465

Is it to avoid having to create a new tx with 2 dummy inputs in a future purchase? Also, do they have any specific values?

@nothing0012
Copy link
Member

Yes, they're used for future purchase, so that people don't need to prepare the dummy utxos again

@dannydeezy
Copy link

i don't understand the need for the 2 dummy utxos, can you point me to any materials where i can learn?

@casey
Copy link

casey commented Sep 2, 2023

I was curious about why this library uses two dummy inputs as well. I think it's because if you only use one dummy input, the ordinal winds up being unaligned. Let's say we use one dummy and have a final transaction with inputs valued A, A, and B, and outputs valued 2 A and B, with the ordinal being sold on the first sat of the second A input:

A    2A
A -> B
B

The transaction value balances, however the ordinal will wind up in the middle of the first output.

If, on the other hand, we add an additional dummy:

A    2A
A    A
A -> B
B

Then the ordinals winds up on the first sat of the second output.

And two dummy outputs are used because that's the number of dummy inputs required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants