View Source BitcoinLib.Script.Types.P2pkh (BitcoinLib v0.4.3)

P2PKH helper that can issue scripts out of simple parameters

Link to this section Summary

Functions

Returns a full P2PKH script out of a public key hash

Link to this section Functions

Link to this function

create(target_public_key_hash)

View Source
@spec create(bitstring()) :: list()

Returns a full P2PKH script out of a public key hash

examples

Examples

iex> <<0xafc3e518577316386188af748a816cd14ce333f2::160>>
...> |> BitcoinLib.Script.Types.P2pkh.create()
[
  %BitcoinLib.Script.Opcodes.Stack.Dup{},
  %BitcoinLib.Script.Opcodes.Crypto.Hash160{},
  %BitcoinLib.Script.Opcodes.Data{value: <<0xafc3e518577316386188af748a816cd14ce333f2::160>>},
  %BitcoinLib.Script.Opcodes.BitwiseLogic.EqualVerify{},
  %BitcoinLib.Script.Opcodes.Crypto.CheckSig{script: <<0x76a914afc3e518577316386188af748a816cd14ce333f288ac::200>>}
]