def extract_public_key(bytes, version='\x00'):
    try:
        decoded = [ x for x in script_GetOp(bytes) ]
    except struct.error:
        return "(None)"
    match = [ opcodes.OP_PUSHDATA4, opcodes.OP_PUSHDATA4 ]
    if match_decoded(decoded, match):
        return public_key_to_bc_address(decoded[1][1], version=version)
    match = [ opcodes.OP_PUSHDATA4, opcodes.OP_CHECKSIG ]
    if match_decoded(decoded, match):
        return public_key_to_bc_address(decoded[0][1], version=version)
    match = [ opcodes.OP_DUP, opcodes.OP_HASH160, opcodes.OP_PUSHDATA4, opcodes.OP_EQUALVERIFY, opcodes.OP_CHECKSIG ]
    if match_decoded(decoded, match):
        return hash_160_to_bc_address(decoded[2][1], version=version)
    multisigs = [
      [ opcodes.OP_1, opcodes.OP_PUSHDATA4, opcodes.OP_1, opcodes.OP_CHECKMULTISIG ],
      [ opcodes.OP_2, opcodes.OP_PUSHDATA4, opcodes.OP_PUSHDATA4, opcodes.OP_2, opcodes.OP_CHECKMULTISIG ],
      [ opcodes.OP_3, opcodes.OP_PUSHDATA4, opcodes.OP_PUSHDATA4, opcodes.OP_3, opcodes.OP_CHECKMULTISIG ]
    ]
    for match in multisigs:
        if match_decoded(decoded, match):
            return "["+','.join([public_key_to_bc_address(decoded[i][1]) for i in range(1,1-len(decoded))])+"]"
    match = [ opcodes.OP_HASH160, 0x14, opcodes.OP_EQUAL ]
    if match_decoded(decoded, match):
        return hash_160_to_bc_address(decoded[1][1], version="\x05")
    return "(None)"
dataset/ETHPy150Open bitxbay/BitXBay/deserialize.py/extract_public_key/swapped operands of `-`