BootstrapWitness

class cometa.witness_set.bootstrap_witness.BootstrapWitness(ptr)[source]

Bases: object

Represents a bootstrap witness for Byron-era addresses.

Bootstrap witnesses are used to sign transactions that spend from Byron-era addresses. They include additional information beyond just the public key and signature, such as the chain code and address attributes.

__init__(ptr)[source]
Return type:

None

__enter__()[source]
Return type:

BootstrapWitness

__exit__(exc_type, exc_val, exc_tb)[source]
Return type:

None

__repr__()[source]

Return repr(self).

Return type:

str

classmethod new(vkey, signature, chain_code, attributes)[source]

Creates a new bootstrap witness.

Parameters:
  • vkey (bytes) – The verification key (32 bytes for Ed25519).

  • signature (bytes) – The signature (64 bytes for Ed25519).

  • chain_code (bytes) – The chain code (32 bytes).

  • attributes (bytes) – The address attributes (CBOR encoded).

Returns:

A new BootstrapWitness instance.

Raises:

CardanoError – If creation fails.

Return type:

BootstrapWitness

classmethod from_cbor(reader)[source]

Deserializes a BootstrapWitness from CBOR data.

Parameters:

reader (CborReader) – A CborReader positioned at the witness data.

Returns:

A new BootstrapWitness deserialized from the CBOR data.

Raises:

CardanoError – If deserialization fails.

Return type:

BootstrapWitness

to_cbor(writer)[source]

Serializes the witness to CBOR format.

Parameters:

writer (CborWriter) – A CborWriter to write the serialized data to.

Raises:

CardanoError – If serialization fails.

Return type:

None

property vkey: bytes

The verification key (public key).

Returns:

The 32-byte Ed25519 public key.

property signature: bytes

The signature.

Returns:

The 64-byte Ed25519 signature.

property chain_code: bytes

The chain code for key derivation.

Returns:

The 32-byte chain code.

property attributes: bytes

The address attributes (CBOR encoded).

Returns:

The attributes bytes.

to_cip116_json(writer)[source]

Serializes this object to CIP-116 compliant JSON.

Parameters:

writer (JsonWriter) – The JsonWriter to write the JSON to.

Raises:

CardanoError – If serialization fails.

Return type:

None