INNER CODE UNIT · Python

control_block

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

            control_block = witness_stack[-1]
            internal_key = control_block[1:33]
            if internal_key == NUMS_H:  # skip
                return b''

        # Convert to x-only (32 bytes) for taproot
        if len(pubkey) == 33:
            pubkey = pubkey[1:]  # Remove prefix byte
        return pubkey
    else:  # regular input - use full compressed pubkey (33 bytes)
        return pubkey

def gen_byte_array(hex):
    assert len(hex) % 2 == 0
    if hex == "":
        return "{0x00}"
    s = ',0x'.join(a + b for a, b in zip(hex[::2], hex[1::2]))
    return "{0x" + s + "}"

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…