Skip to content

Commit 3a1b103

Browse files
committed
[Doc] RPC getrawtransaction and decoderawtransaction, sapling transaction data
1 parent 9d95c16 commit 3a1b103

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

src/rpc/rawtransaction.cpp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,35 @@ void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry)
9595
}
9696
}
9797

98+
std::string GetSaplingTxHelpInfo()
99+
{
100+
return " \"valueBalance\": n, (numeric) The net value of spend transfers minus output transfers\n"
101+
" \"valueBalanceSat\": n, (numeric) `valueBalance` in sats\n"
102+
" \"vShieldSpend\": [ (array of json objects)\n"
103+
" {\n"
104+
" \"cv\": \"hex\", (string) A value commitment to the value of the input note\n"
105+
" \"anchor\": hex, (string) A Merkle root of the Sapling note commitment tree at some block height in the past\n"
106+
" \"nullifier\": hex, (string) The nullifier of the input note\n"
107+
" \"rk\": hex, (string) The randomized public key for spendAuthSig\n"
108+
" \"proof\": hex, (string) A zero-knowledge proof using the spend circuit\n"
109+
" \"spendAuthSig\": hex, (string) A signature authorizing this spend\n"
110+
" }\n"
111+
" ,...\n"
112+
" ],\n"
113+
" \"vShieldOutput\": [ (array of json objects)\n"
114+
" {\n"
115+
" \"cv\": hex, (string) A value commitment to the value of the output note\n"
116+
" \"cmu\": hex, (string) The u-coordinate of the note commitment for the output note\n"
117+
" \"ephemeralKey\": hex, (string) A Jubjub public key\n"
118+
" \"encCiphertext\": hex, (string) A ciphertext component for the encrypted output note\n"
119+
" \"outCiphertext\": hex, (string) A ciphertext component for the encrypted output note\n"
120+
" \"proof\": hex, (string) A zero-knowledge proof using the output circuit\n"
121+
" }\n"
122+
" ,...\n"
123+
" ],\n"
124+
" \"bindingSig\": hex, (string) Prove consistency of valueBalance with the value commitments in spend descriptions and output descriptions, and proves knowledge of the randomness used for the spend and output value commitments\n";
125+
}
126+
98127
UniValue getrawtransaction(const JSONRPCRequest& request)
99128
{
100129
if (request.fHelp || request.params.size() < 1 || request.params.size() > 3)
@@ -155,6 +184,7 @@ UniValue getrawtransaction(const JSONRPCRequest& request)
155184
" }\n"
156185
" ,...\n"
157186
" ],\n"
187+
+ GetSaplingTxHelpInfo() +
158188
" \"shielded_addresses\" (json array of string) the shielded addresses involved in this transaction if possible (only for shielded transactions and the tx owner/viewer)\n"
159189
" \"extraPayloadSize\" : n (numeric) Size of extra payload. Only present if it's a special TX\n"
160190
" \"extraPayload\" : \"hex\" (string) Hex encoded extra payload data. Only present if it's a special TX\n"
@@ -367,6 +397,7 @@ UniValue decoderawtransaction(const JSONRPCRequest& request)
367397
" }\n"
368398
" ,...\n"
369399
" ],\n"
400+
+ GetSaplingTxHelpInfo() +
370401
" \"extraPayloadSize\" : n (numeric) Size of extra payload. Only present if it's a special TX\n"
371402
" \"extraPayload\" : \"hex\" (string) Hex encoded extra payload data. Only present if it's a special TX\n"
372403
"}\n"

0 commit comments

Comments
 (0)