Function lockingBytecodeToAddressContents

  • Attempt to match a lockingBytecode to a standard address type for use in address encoding. (See LockingBytecodeType for details.)

    For a locking bytecode matching the Pay to Public Key Hash (P2PKH) pattern, the returned type is LockingBytecodeType.p2pkh and payload is the HASH160 of the public key.

    For a locking bytecode matching the 20-byte Pay to Script Hash (P2SH20) pattern, the returned type is LockingBytecodeType.p2sh20 and payload is the HASH160 of the redeeming bytecode, A.K.A. "redeem script hash".

    For a locking bytecode matching the Pay to Public Key (P2PK) pattern, the returned type is LockingBytecodeType.p2pk and payload is the full public key.

    Any other locking bytecode will return a type of LockingBytecodeType.unknown and a payload of the unmodified bytecode.

    Parameters

    • bytecode: Uint8Array

      the locking bytecode to match

    Returns AddressContents

Generated using TypeDoc