Bitcoin: Why does walletprocesspsbt finalize the psbt but not return the transaction hex?
Understanding Bitcoin: Why WalletProcessbt
ends the PSBT, but does not return hexadecimal to the transaction
As you use the popular process portfolio to finish the binary tree in the payment script (PSBT) and add the BIP32 way. Production, you are certain that this command returns a finished PSBT. However, when adding a new path derived to a PSBT already signed and finished, it does not return directly to the transaction.
In Bitcoin, the hash of each transaction is represented as a 64 byth hexadecimal string. When you add a new path derived to the PSBT, the processbt portfolio generates this new hexadecimal performance of a transaction hash. This is done using the BIP32.reivation 'method and then binary data hashs obtained.
Here is what happens step by step:
- The portfolio portfolio process signs the input transaction with its private key.
- Creates a binary tree on the signed transaction payment script (PSBT), which includes all the information needed to project production.
- The portfolio portfolio process adds a new path derived to the PSBT using the 'Bip32.reivative' method, specifying the path of a custom derivative.
When you start the WalletProcessBT, you finish the PSBT, it generates a PSBT finished with the path added to the derivative. However, instead of returning directly to the transaction, it returns an object that contains the finished PSBT and other metadata.
Why don't you return the hexadecimal transaction?
The portfolio process returns the completed PSBT, as it is a binary format that represents the script tree for payment.BIP32.reitionuses an algorithm for hash (Sha-256, in this case) to generate the new path of the derivative and the related value of the hash.
When you pass the PSBT finished from the RPC command, such as' GetTransction 'or print your content using' Dumpwallet, the portfolio processes will return the same object that contains the finished PSBTs and other metadata. However, the presentation of the tenth sixth of the transaction hash does not return directly; Instead, it is incorporated on this site.
An example of use of the case:
Suppose you have a transaction signed with a 30 bych tXID
and Voutinput (for example,
txinmap= [0x1234, 0x5678]))). The portfolio process signs the transaction using its private key:
Bash
WALLETPROCESSBT FINALIZE TXID VOUT1 TXINMAP = 0x1234 0x5678 -Naith = Myderivation
After completing this command, you get a completed PSBT containing the signed transaction binary data and other metadata. Then you add a new path derived to the PSBT using BIP32.REATIVE
:
`Bash
WalletProcessBT Eutters PSBT TXID1 TXINMAP = 0x1234 0x5678 -riva = myderivation - -adpath = beep32path
Process portfolios will return an object containing the completed PSBTs and other metadata, including the transaction hash as a hexadecimal string.
In short, when you add a new path derived to a PSBT already signed and finished using the WalletProcessbt, the command returns an object containing the finished PSBT and other metadata. The transactional hexagon does not return directly; Instead, it is incorporated on this site.