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

zcash_client_backend: Add backend functionality required to support fundrawtransaction #1695

Open
nuttycom opened this issue Feb 4, 2025 · 0 comments

Comments

@nuttycom
Copy link
Contributor

nuttycom commented Feb 4, 2025

fundrawtransaction is a zcashd wallet method that is required for use with offline signing protocols, and is consequently required by exchanges. It is documented as:

Usage: fundrawtransaction "hexstring" includeWatching

Add transparent inputs to a transaction until it has enough in value to meet its out value.
This will not modify existing inputs, and will add one change output to the outputs.
Note that inputs which were signed may need to be resigned after completion since in/outputs have been added.
The inputs added will not be signed, use signrawtransaction for that.
Note that all existing inputs must have their previous output transaction be in the wallet.
Note that all inputs selected must be of standard form and P2SH scripts must bein the wallet using importaddress or addmultisigaddress (to calculate fees).
Only pay-to-pubkey, multisig, and P2SH versions thereof are currently supported for watch-only

Arguments:
1. "hexstring"     (string, required) The hex string of the raw transaction
2. includeWatching (boolean, optional, default false) Also select inputs which are watch only

Result:
{
  "hex":       "value", (string)  The resulting raw transaction (hex-encoded string)
  "fee":       n,         (numeric) The fee added to the transaction
  "changepos": n          (numeric) The position of the added change output, or -1
}
"hex"

Examples:

Create a transaction with no inputs
> zcash-cli createrawtransaction "[]" "{\"myaddress\":0.01}"

Add sufficient unsigned inputs to meet the output value
> zcash-cli fundrawtransaction "rawtransactionhex"

Sign the transaction
> zcash-cli signrawtransaction "fundedtransactionhex"

Send the transaction
> zcash-cli sendrawtransaction "signedtransactionhex"
@nuttycom nuttycom added this to the Zcashd wallet replacement milestone Feb 4, 2025
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

No branches or pull requests

1 participant