-
Notifications
You must be signed in to change notification settings - Fork 6
Update to use PSET and to allow signing #12
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
base: master
Are you sure you want to change the base?
Update to use PSET and to allow signing #12
Conversation
72ccfe2 to
07bb2da
Compare
|
I'm not yet sure whether there's a kind of ack that I can appropriately offer here, but I saw this PR's functionality demonstrated successfully against Liquid Testnet this afternoon, so informally I think it's great. |
|
I will pull it apart into separate PRs and try to get them merged. I'll make sure that this PR/branch remains usable and complete for purposes of doing end-to-end Simplicity program stuff. |
07bb2da to
4e73c48
Compare
af63781 to
8ce1fe2
Compare
Refactor the code a bit to allow parsing arbitrary strings as either hex or base 64.
We will want to be able to parse this format for PSET support.
If you provide a PSET instead of a raw transaction, then attempt to extract a transaction from it.
This command takes a PSET where we've updated all the inputs (with 'simplicity pset update-input' for example), as well as a program and a valid witness. It executes the program, prunes it, then adds it to the PSET. Then you can extract and send the program with elements-cli.
Now rather than extracting using elements-cli, by running
elements-cli finalizepsbt <psbt> true
you can do it with hal-simplicity, with
hal-simplicity simplicity pset extract <psbt>
8ce1fe2 to
010db0e
Compare
This should be compatible with any non-pegin non-issuance calls to elements-cli createpsbt. Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <[email protected]>
010db0e to
cacd1f7
Compare
delta1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK cacd1f7
CLI tests can be added in a follow-up
| #[serde(with = "elements::bitcoin::amount::serde::as_btc")] | ||
| amount: elements::bitcoin::Amount, | ||
| }, | ||
| Map(HashMap<String, f64>), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need a follow-up to support non-policy assets?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so. This is the same as the elements-cli createpsbt interface. If you want non-policy assets then you need to use the verbose form of the command in the other enum variant.
apoelstra
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On cacd1f7 successfully ran local tests
Introduces several new PSET-manipulation commands to allow using this tool without needing an Elements daemon (other than for blockchain data access, which can be obtained from web APIs instead).
In particular we add:
simplicity pset update-inputwhich attaches Simplicity-related data to a specific inputsimplicity pset finalizewhich takes a Simplicity program and witness, executes and prunes the program, and attaches the data to the witnesssimplicity pset extractwhich constructs a complete transaction from a finalized PSETThis also extends
simplicity sighashto work with PSETs rather than requiring the user copy/paste tons of stuff in the CLI interface.