Skip to content

Commit 29eafd5

Browse files
committed
rpc: doc: use "output script" terminology consistently in "asm"/"hex" results
The wording "public key script" was likely chosen as a human-readable form of the technical term `scriptPubKey`, but it doesn't seem to be really widespread. Replace it by the more common term "output script" instead. Note that the argument for the `decodescript` RPC is not necessarily an output script (it could e.g. be also a redeem script), so in this case we just stay generic and use "script". See also the draft BIP "Terminology for Transaction Components" (https://github.com/murchandamus/bips/blob/2022-04-tx-terminology/bip-tx-terminology.mediawiki) which suggests to use "output script" as well. Affects the help text of the following RPCs: - decodepsbt - decoderawtransaction - decodescript - getblock (if verbosity=3) - getrawtransaction (if verbosity=2,3) - gettxout
1 parent bd5d168 commit 29eafd5

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/rpc/blockchain.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -654,9 +654,9 @@ const RPCResult getblock_vin{
654654
{RPCResult::Type::STR_AMOUNT, "value", "The value in " + CURRENCY_UNIT},
655655
{RPCResult::Type::OBJ, "scriptPubKey", "",
656656
{
657-
{RPCResult::Type::STR, "asm", "Disassembly of the public key script"},
657+
{RPCResult::Type::STR, "asm", "Disassembly of the output script"},
658658
{RPCResult::Type::STR, "desc", "Inferred descriptor for the output"},
659-
{RPCResult::Type::STR_HEX, "hex", "The raw public key script bytes, hex-encoded"},
659+
{RPCResult::Type::STR_HEX, "hex", "The raw output script bytes, hex-encoded"},
660660
{RPCResult::Type::STR, "address", /*optional=*/true, "The Bitcoin address (only if a well-defined address exists)"},
661661
{RPCResult::Type::STR, "type", "The type (one of: " + GetAllOutputTypes() + ")"},
662662
}},
@@ -1056,9 +1056,9 @@ static RPCHelpMan gettxout()
10561056
{RPCResult::Type::NUM, "confirmations", "The number of confirmations"},
10571057
{RPCResult::Type::STR_AMOUNT, "value", "The transaction value in " + CURRENCY_UNIT},
10581058
{RPCResult::Type::OBJ, "scriptPubKey", "", {
1059-
{RPCResult::Type::STR, "asm", "Disassembly of the public key script"},
1059+
{RPCResult::Type::STR, "asm", "Disassembly of the output script"},
10601060
{RPCResult::Type::STR, "desc", "Inferred descriptor for the output"},
1061-
{RPCResult::Type::STR_HEX, "hex", "The raw public key script bytes, hex-encoded"},
1061+
{RPCResult::Type::STR_HEX, "hex", "The raw output script bytes, hex-encoded"},
10621062
{RPCResult::Type::STR, "type", "The type, eg pubkeyhash"},
10631063
{RPCResult::Type::STR, "address", /*optional=*/true, "The Bitcoin address (only if a well-defined address exists)"},
10641064
}},

src/rpc/rawtransaction.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ static void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue&
8585
static std::vector<RPCResult> ScriptPubKeyDoc() {
8686
return
8787
{
88-
{RPCResult::Type::STR, "asm", "Disassembly of the public key script"},
88+
{RPCResult::Type::STR, "asm", "Disassembly of the output script"},
8989
{RPCResult::Type::STR, "desc", "Inferred descriptor for the output"},
90-
{RPCResult::Type::STR_HEX, "hex", "The raw public key script bytes, hex-encoded"},
90+
{RPCResult::Type::STR_HEX, "hex", "The raw output script bytes, hex-encoded"},
9191
{RPCResult::Type::STR, "address", /*optional=*/true, "The Bitcoin address (only if a well-defined address exists)"},
9292
{RPCResult::Type::STR, "type", "The type (one of: " + GetAllOutputTypes() + ")"},
9393
};
@@ -506,18 +506,18 @@ static RPCHelpMan decodescript()
506506
RPCResult{
507507
RPCResult::Type::OBJ, "", "",
508508
{
509-
{RPCResult::Type::STR, "asm", "Script public key"},
509+
{RPCResult::Type::STR, "asm", "Disassembly of the script"},
510510
{RPCResult::Type::STR, "desc", "Inferred descriptor for the script"},
511511
{RPCResult::Type::STR, "type", "The output type (e.g. " + GetAllOutputTypes() + ")"},
512512
{RPCResult::Type::STR, "address", /*optional=*/true, "The Bitcoin address (only if a well-defined address exists)"},
513513
{RPCResult::Type::STR, "p2sh", /*optional=*/true,
514514
"address of P2SH script wrapping this redeem script (not returned for types that should not be wrapped)"},
515515
{RPCResult::Type::OBJ, "segwit", /*optional=*/true,
516-
"Result of a witness script public key wrapping this redeem script (not returned for types that should not be wrapped)",
516+
"Result of a witness output script wrapping this redeem script (not returned for types that should not be wrapped)",
517517
{
518-
{RPCResult::Type::STR, "asm", "String representation of the script public key"},
519-
{RPCResult::Type::STR_HEX, "hex", "Hex string of the script public key"},
520-
{RPCResult::Type::STR, "type", "The type of the script public key (e.g. witness_v0_keyhash or witness_v0_scripthash)"},
518+
{RPCResult::Type::STR, "asm", "Disassembly of the output script"},
519+
{RPCResult::Type::STR_HEX, "hex", "The raw output script bytes, hex-encoded"},
520+
{RPCResult::Type::STR, "type", "The type of the output script (e.g. witness_v0_keyhash or witness_v0_scripthash)"},
521521
{RPCResult::Type::STR, "address", /*optional=*/true, "The Bitcoin address (only if a well-defined address exists)"},
522522
{RPCResult::Type::STR, "desc", "Inferred descriptor for the script"},
523523
{RPCResult::Type::STR, "p2sh-segwit", "address of the P2SH script wrapping this witness redeem script"},
@@ -833,9 +833,9 @@ const RPCResult decodepsbt_inputs{
833833
{RPCResult::Type::NUM, "amount", "The value in " + CURRENCY_UNIT},
834834
{RPCResult::Type::OBJ, "scriptPubKey", "",
835835
{
836-
{RPCResult::Type::STR, "asm", "Disassembly of the public key script"},
836+
{RPCResult::Type::STR, "asm", "Disassembly of the output script"},
837837
{RPCResult::Type::STR, "desc", "Inferred descriptor for the output"},
838-
{RPCResult::Type::STR_HEX, "hex", "The raw public key script bytes, hex-encoded"},
838+
{RPCResult::Type::STR_HEX, "hex", "The raw output script bytes, hex-encoded"},
839839
{RPCResult::Type::STR, "type", "The type, eg 'pubkeyhash'"},
840840
{RPCResult::Type::STR, "address", /*optional=*/true, "The Bitcoin address (only if a well-defined address exists)"},
841841
}},

0 commit comments

Comments
 (0)