@@ -968,15 +968,18 @@ and height.
968968 *height *
969969
970970 Optionally, the height at which it was confirmed, an integer.
971- Clients are encouraged to provide this field when they can, to reduce server load.
971+ The server (especially lighter ones such as EPS/BWT) might require this parameter
972+ to be able to serve the request, in which case the server must indicate so in its
973+ :func: `server.features ` response, by setting
974+ `method_flavours["blockchain.transaction.get_merkle"]["requires_height"]=true `.
972975
973976**Result **
974977
975978 A dictionary with the following keys:
976979
977980 * *block_height *
978981
979- The height of the block the transaction was confirmed in.
982+ The height of the block the transaction was confirmed in, an integer .
980983
981984 * *block_hash *
982985
@@ -991,7 +994,7 @@ and height.
991994 * *pos *
992995
993996 The 0-based index of the position of the transaction in the
994- ordered list of transactions in the block.
997+ ordered list of transactions in the block, an integer .
995998
996999**Result Example **
9971000
@@ -1017,6 +1020,80 @@ and height.
10171020 "pos": 710
10181021 }
10191022
1023+ blockchain.transaction.get_merkle_witness
1024+ =========================================
1025+
1026+ Witness-SPV. Proves that a transaction with a given wtxid was mined in a particular block.
1027+
1028+ **Signature **
1029+
1030+ .. function :: blockchain.transaction.get_merkle_witness(txid, height=None, cb=false)
1031+ .. versionadded :: 1.6
1032+
1033+ *txid *
1034+
1035+ The txid (NOT wtxid) as a hexadecimal string.
1036+
1037+ *height *
1038+
1039+ Optionally, the height at which it was confirmed, an integer.
1040+ The server (especially lighter ones such as EPS/BWT) might require this parameter
1041+ to be able to serve the request, in which case the server must indicate so in its
1042+ :func: `server.features ` response, by setting
1043+ `method_flavours["blockchain.transaction.get_merkle"]["requires_height"]=true `.
1044+ (the flavour key `"blockchain.transaction.get_merkle" ` is reused with the other merkle method).
1045+
1046+ *cb *
1047+
1048+ A boolean.
1049+ If set to :const: `true `, the result MUST also include the *cb_tx * and *cb_proof * fields.
1050+ If set to :const: `false `, those fields are omitted.
1051+
1052+ **Result **
1053+
1054+ A dictionary with the following keys:
1055+
1056+ * *wtxid *
1057+
1058+ The wtxid of the mined transaction, as a hexadecimal string.
1059+
1060+ * *block_height *
1061+
1062+ The height of the block the transaction was confirmed in, an integer.
1063+
1064+ * *block_hash *
1065+
1066+ The hash of the block the transaction was confirmed in, as a hexadecimal string.
1067+
1068+ * *pos *
1069+
1070+ The 0-based index of the position of the transaction in the
1071+ ordered list of transactions in the block, an integer.
1072+
1073+ * *cb_tx *
1074+
1075+ The raw coinbase transaction from the block, as a hexadecimal string.
1076+
1077+ * *cb_proof *
1078+
1079+ Merkle branch to prove `cb_tx ` (against block header merkle root).
1080+ A list of transaction hashes the current hash is paired with,
1081+ recursively, in order to trace up to obtain merkle root of the
1082+ block (in header), deepest pairing first.
1083+
1084+ * *wmerkle *
1085+
1086+ A witness merkle branch to prove `wtxid ` (against `cb_tx `).
1087+ A list of hashes the current hash is paired with,
1088+ recursively, in order to trace up to obtain `witness root hash `
1089+ (committed to in the coinbase), deepest pairing first.
1090+
1091+ **Result Example **
1092+
1093+ ::
1094+
1095+ TODO
1096+
10201097blockchain.transaction.id_from_pos
10211098==================================
10221099
0 commit comments