8000 Add namepsbt RPC method by domob1812 · Pull Request #362 · namecoin/namecoin-core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add namepsbt RPC method #362

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

Merged
merged 1 commit into from
Aug 24, 2020
Merged

Add namepsbt RPC method #362

merged 1 commit into from
Aug 24, 2020

Conversation

domob1812
Copy link

This adds a new RPC method, namepsbt. It works in the same way as namerawtransaction to add a name operation to an existing output, but operates on PSBTs rather than hex-format raw transactions. This fixes #361.

With this, it is possible to go through the entire name-trading workflow with just PSBTs and without any hex-format raw transactions. However, it is not yet possible to let the wallet fund the transaction, as that requires funding without the out-of-wallet name input first and only later adding it to the PSBT. Once bitcoin/bitcoin#19608 is implemented, this will be possible as well.

This adds a new RPC method, namepsbt.  It works in the same way as
namerawtransaction to add a name operation to an existing output, but
operates on PSBTs rather than hex-format raw transactions.
@domob1812 domob1812 added this to the nc0.21 milestone Aug 4, 2020
@domob1812
Copy link
Author

@JeremyRand please take a look if that is what you need. I will merge this in a couple of days if there are no objections.

@JeremyRand
Copy link
Member

Concept ACK, will try to review the code shortly (but feel free to merge anyway if I take too long).

However, it is not yet possible to let the wallet fund the transaction, as that requires funding without the out-of-wallet name input first and only later adding it to the PSBT. Once bitcoin/bitcoin#19608 is implemented, this will be possible as well.

@domob1812 Can you elaborate a bit on what workflow would be involved with and without a fix for that upstream issue? I'm under the impression that we'd want a PSBT equivalent of fundrawtransaction for this. The intent of that upstream issue was to avoid signatures getting lost (which is important for non-interactive SIGHASH_SINGLE|SIGHASH_ANYONECANPAY transactions, but seems like a different issue than what fundrawtransaction does).

@domob1812
Copy link
Author
domob1812 commented Aug 4, 2020

@JeremyRand Yes, in principle we want fundrawtransaction, which actually exists: walletcreatefundedpsbt. But the issue is that this function only works if it can solve all inputs (see bitcoin/bitcoin#7879), and that is not the case for some of the inputs if you do an atomic name trade.

So what you can do to work around this is to create the funded transaction without the name input/output (well, I guess you can even include the output if you want) and add a bit of extra fee to it, and then add the name input/output to it with the requested feature.

(Note that I only looked into this in the context of fundrawtransaction and not walletcreatefundedpsbt, so maybe I'm wrong here and you can actually do all that right now. In that case I'd be interested to learn how.)

@domob1812
Copy link
Author

@JeremyRand Any more feedback on this? If not, I will merge it in a couple of days.

@domob1812 domob1812 merged commit 11d3163 into namecoin:master Aug 24, 2020
domob1812 added a commit to xaya/xaya that referenced this pull request Aug 24, 2020
This updates namecoin/namecoin-core#362
for Xaya (mostly for name_register instead of name_new and
name_firstupdate).
@domob1812 domob1812 deleted the name-psbt branch September 4, 2020 06:54
domob1812 added a commit to domob1812/namecoin-core that referenced this pull request Sep 4, 2020
When namepsbt was added in namecoin#362,
the built-in RPC client was not updated and thus failed to correctly
convert the "vout" argument to a number and the "nameop" one to a
JSON object.  Hence, namecoin-cli and the built-in console in the Qt UI
were not able to use namepsbt.  This fixes the client accordingly.
domob1812 pushed a commit that referenced this pull request Aug 30, 2021
7c33e3a qt: Add missing mnemonics in menu bar options (Shashwat)

Pull request description:

  Since #362 we have defaulted to add mnemonic shortcuts for the context menus.
  The Window -> Minimize option and File -> Load PSBT from clipboard were hitherto missing a mnemonic shortcut. This PR adds mnemonic shortcuts for them

  Changes introduced in this PR:
  | Master | PR |
  | ----------| ---- |
  | ![Screenshot from 2021-08-23 23-10-07](https://user-images.githubusercontent.com/85434418/130494098-c65ec9da-c3f1-4243-9b3d-0c87cb677825.png) | ![Screenshot from 2021-08-23 23-08-41](https://user-images.githubusercontent.com/85434418/130494083-849ffd14-05e9-4a6d-bdc3-b3e55b8a8861.png)|
  |![Screenshot from 2021-08-23 23-10-21](https://user-images.githubusercontent.com/85434418/130494233-1b2e8838-c5d4-48a8-9abf-a4acc8d6146c.png)|![Screenshot from 2021-08-23 23-09-00](https://user-images.githubusercontent.com/85434418/130494181-dcdbf119-a2c6-469d-a6c9-3021506ab40b.png)|

ACKs for top commit:
  jarolrod:
    tACK 7c33e3a
  hebasto:
    ACK 7c33e3a, tested on Linux Mint 20.2 (Qt 5.12.8).

Tree-SHA512: 32f201ae7716b19ca123856292f8bfa0d805f6c7271ac1b5e08eff6b95017443754c8a76e8396ccca1869a57384e11016cbd99d63ccdd2fae6da4eaf3ae32298
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"namerawtransaction" equivalent for PSBT API
2 participants
0