common.appointment

class Appointment(locator, encrypted_blob, to_self_delay)[source]

Bases: object

The Appointment contains the information regarding an appointment between a client and the Watchtower.

Parameters
  • locator (str) – A 16-byte hex-encoded value used by the tower to detect channel breaches. It serves as a trigger for the tower to decrypt and broadcast the penalty transaction.

  • encrypted_blob (str) – An encrypted blob of data containing a penalty transaction. The tower will decrypt it and broadcast the penalty transaction upon seeing a breach on the blockchain.

  • to_self_delay (int) – The to_self_delay encoded in the csv of the to_remote output of the commitment transaction that this appointment is covering.

classmethod from_dict(appointment_data)[source]

Builds an appointment from a dictionary.

Parameters

appointment_data (dict) – a dictionary containing the following keys: {locator, to_self_delay, encrypted_blob}

Returns

An appointment initialized using the provided data.

Return type

Appointment

Raises

ValueError – If one of the mandatory keys is missing in appointment_data.

serialize()[source]

Serializes an appointment to be signed.

The serialization follows the same ordering as the fields in the appointment:

locator | encrypted_blob | to_self_delay

All values are big endian.

Returns

The serialized data to be signed.

Return type

bytes

to_dict()[source]

Encodes an appointment as a dictionary.

Returns

A dictionary containing the appointment attributes.

Return type

dict