NAME

Bitcoin::Crypto::Transaction::ControlBlock - BIP341 Control blocks

SYNOPSIS

DESCRIPTION

This module contains implementation of control blocks described in BIP341. These blocks are used by taproot and are necessary to build transactions using custom taproot scripts.

INTERFACE

Attributes

control_byte

Required in constructor.

This attribute contains a control byte in form of an integer.

public_key

Required in constructor.

This attribute contains an instance of Bitcoin::Crypto::Key::Public.

script_blocks

Required in constructor.

This attribute contains an array reference of bytestrings. These blocks can be used in "from_path" in Bitcoin::Crypto::Script::Tree.

METHODS

new

$tree = $class->new(%args)

Standard Moo constructor - see "Attributes".

from_serialized

$object = $class->from_serialized($bytestr)

Standard deserialization method. Returns a new instance.

to_serialized

$bytestr = $object->to_serialized()

Standard serialization method.

get_leaf_version

$leaf_version = $object->get_leaf_version()

Returns a leaf version, which is equal to control_byte & 0xfe.

SEE ALSO

Bitcoin::Crypto::Script::Tree
Bitcoin::Crypto::Transaction