-
Notifications
You must be signed in to change notification settings - Fork 38.7k
rpc: Add support to populate PSBT input utxos via rpc #30886
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
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/30886. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
527301e to
abc8352
Compare
pablomartin4btc
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.
ACK abc835282a66495f65f342cfc113e45aac4ebb48
- Was this functionality already exposed somewhere I missed?
I couldn't find anything but perhaps I missed some.
- Should "non-witness utxos" always be the type added when updating the PSBT? Looks like we fill in non-witness wherever we can, and witness whenever scraping from utxo set
You mean that segwit txs would need to be converted into legacy ones to be passed in prev_txs?
I've checked the test and I understand the use case, but could you please expand a bit on the reasons why prev txs "can not be entered into the mempool or UTXO set", if possible?
|
@pablomartin4btc I expanded on the use-case a bit in the OP For (2) I was asking what was typically done for |
This comment was marked as abuse.
This comment was marked as abuse.
BrandonOdiwuor
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.
Concept ACK
rkrux
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.
tACK abc8352
Successful make and functional tests.
I manually tested the new argument in utxoupdatepsbt using my regtest environment by creating parent transaction and a subsequent child transaction. Processing the child PSBT without passing in the raw parent transaction hex led to incomplete processing and was successful later when the parent was passed.
Also tested for duplicate parent transaction error.
abc8352 to
b6f701d
Compare
|
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
b6f701d to
b1ec4d5
Compare
This feature is useful when construction a series of presigned transactions that can not be entered into the mempool or UTXO set before signing everything.
b1ec4d5 to
87ceb61
Compare
rkrux
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.
tACK 87ceb61
Rebuilt and reran functional tests.
| return ret; | ||
| } | ||
|
|
||
| std::vector<CTransactionRef> ParseTransactionVector(const UniValue txns_param) |
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.
Thanks, this pure function implementation is nice!
|
This is far easier to use compared to the earlier way of |
This feature is useful when construction a series of presigned transactions that can not be entered into the mempool or UTXO set before signing everything. Github-Pull: bitcoin#30886 Rebased-From: 87ceb61
|
I'm not sure this has proper amount of user demand, putting into draft in case someone stumbles on it and says otherwise |
|
🐙 This pull request conflicts with the target branch and needs rebase. |
|
Closing this as it has not had any activity in a while. If you are interested in continuing work on this, please leave a comment so that it can be reopened. |
Resolves #30873
The typical use-case would be when you have a too low-fee(perhaps presigned) or timelocked parent transaction where you want to sign the child transaction before broadcasting anything.
You could imagine the parent transaction being a LN commitment transaction at 0 fee, and the child transaction being an anchor spend. Due to the below mempool minimum of the parent, the parent and child transaction must be sent as a pair via
submitpackage, so the parent isn't available in the mempool or utxo set yet.