INNER CODE UNIT · Python

MAX_OUTPUTS_PER_TEST_CASE

BlockstreamResearch/secp256k1-zkp · tools/tests_silentpayments_generate.py:17

MAX_OUTPUTS_PER_TEST_CASE = 2324  # K_max + 1
MAX_RECIPIENT_ENTRIES_PER_TEST_CASE = 4
MAX_LABELS_PER_TEST_CASE = 4
MAX_PERMUTATIONS_PER_SENDING_TEST_CASE = 12
MAX_RECEIVE_SUBTESTS = 2

def sha256(s):
    return hashlib.sha256(s).digest()

def smallest_outpoint(outpoints):
    serialized_outpoints = [bytes.fromhex(txid)[::-1] + n.to_bytes(4, 'little') for txid, n in outpoints]
    return sorted(serialized_outpoints)[0]

def is_p2tr(s):  # OP_1 OP_PUSHBYTES_32 <32 bytes>
    return (len(s) == 34) and (s[0] == 0x51) and (s[1] == 0x20)

def get_pubkey_from_input(input_data, pubkey_hex):
    """Extract the correct pubkey for an input, handling NUMS_H filtering and format conversion"""

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…