From 3aa17caaa31950d2f8879e4c1e384a9a777523ba Mon Sep 17 00:00:00 2001 From: Sebastian Falbesoner Date: Thu, 26 Feb 2026 20:14:59 +0100 Subject: [PATCH] BIP-352: test vectors: allow specifying repeated recipients for sending Introduce an optional "count" field for recipient objects. Also update the documentation of the fields. --- bip-0352.mediawiki | 10 +++++++++- bip-0352/reference.py | 6 +++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/bip-0352.mediawiki b/bip-0352.mediawiki index 83cbd885..508b801a 100644 --- a/bip-0352.mediawiki +++ b/bip-0352.mediawiki @@ -393,7 +393,15 @@ A [[bip-0352/send_and_receive_test_vectors.json|collection of test vectors in JS { "given": { "vin": [], - "recipients": [] + "recipients": [ + { + "address": , + "scan_pub_key": , + "spend_pub_key": , + "count": + }, + ... + ] }, "expected": { "outputs": [], diff --git a/bip-0352/reference.py b/bip-0352/reference.py index 65e0d504..cab3972f 100755 --- a/bip-0352/reference.py +++ b/bip-0352/reference.py @@ -268,7 +268,11 @@ if __name__ == "__main__": sending_outputs = [] if (len(input_pub_keys) > 0): outpoints = [vin.outpoint for vin in vins] - sending_outputs = create_outputs(input_priv_keys, outpoints, given["recipients"], expected=expected, hrp="sp") + recipients = [] # expand given recipient entries to full list + for recipient_entry in given["recipients"]: + count = recipient_entry.get("count", 1) + recipients.extend([recipient_entry] * count) + sending_outputs = create_outputs(input_priv_keys, outpoints, recipients, expected=expected, hrp="sp") # Note: order doesn't matter for creating/finding the outputs. However, different orderings of the recipient addresses # will produce different generated outputs if sending to multiple silent payment addresses belonging to the