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

Add options to inscribe straight to an address, and/or send commit change to an address #1512

Closed
wants to merge 4 commits into from

Conversation

rot13maxi
Copy link
Contributor

@rot13maxi rot13maxi commented Feb 5, 2023

if you want to make sure that the change from the commit transaction goes to a specific address, you can now provide the --commit-change option. Note that if a specific satpoint is being inscribed, we might need two change addresses because the UTXO might need splitting, so passing both the --satpoint option and the --commit-change option will throw an error.

Also, now you can set the --inscription_destination option to set the reveal transaction output to a specific address.

I thought making the change field that gets passed around an enum was the best way to encapsulate the optionality. Happy for feedback on if there's a different way we want to model this.

@casey
Copy link
Collaborator

casey commented Feb 6, 2023

if you want to make sure that the change from the commit transaction goes to a specific address, you can now provide the --commit-change option.

What's the use case for a separate commit change address? If its a desire to control the destination of all change addresses, then we could make it just a --change flag, the user could pass it as many times as they wanted, and we would would initialize the transaction builder with either the default of two change addresses from the wallet, or the change addresses that that had been passed on the command line. This would be a pretty easy change to make and might fit in better with the existing code.

Note that if a specific satpoint is being inscribed, we might need two change addresses because the UTXO might need splitting, so passing both the --satpoint option and the --commit-change option will throw an error.

I kind of don't like adding this specific error case, which would then need a test. See my above comment for how we might avoid this.

Also, now you can set the --inscription_destination option to set the reveal transaction output to a specific address.

This is a great change and I'd like to get this in soon, since users have been asking for it and I clearly understand the use-case. Would you mind splitting that out into its own PR?

I thought making the change field that gets passed around an enum was the best way to encapsulate the optionality. Happy for feedback on if there's a different way we want to model this.

Unless I'm mistaken about the purpose of commit-change, we might be able to reuse TransactionBuilder::{change_addresses, unused_change_addresses} and avoid an extra field.

@casey casey self-requested a review February 6, 2023 23:00
Copy link
Collaborator

@casey casey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hate the red angry "changes requested flag", but this lets me see what's currently blocked on someone else at a glance. They should really make it blue or something T_T

@casey
Copy link
Collaborator

casey commented Feb 6, 2023

Also, just looked at the code more carefully, I see you're already reusing the change address fields, but we could make it a vec, to make the code more general.

@rot13maxi
Copy link
Contributor Author

rot13maxi commented Feb 6, 2023 via email

@rot13maxi
Copy link
Contributor Author

closing in favor of #1536

@rot13maxi rot13maxi closed this Feb 7, 2023
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

Successfully merging this pull request may close these issues.

2 participants