Skip to main content

Module por

Module por 

Source
Expand description

Implements the Proof of Relay.

Structsยง

ProofOfRelayOutput
Derivable challenge which contains the key share of the relayer as well as the secret that was used to create it and the challenge for the next relayer.
ProofOfRelayString
Contains the Proof of Relay challenge for the next downstream node as well as the hint that is used to verify the challenge that is given to the relayer.
ProofOfRelayValues
Type that contains the challenge for the first ticket sent to the first relayer.
SurbReceiverInfo
Wraps the ProofOfRelayValues with some additional information about the sender of the packet, that is supposed to be passed along with the SURB.

Constantsยง

HASH_KEY_ACK_KEY ๐Ÿ”’
HASH_KEY_OWN_KEY ๐Ÿ”’

Functionsยง

derive_ack_key_share
Used in Proof of Relay to derive the half-key of for the acknowledgement (S1) The function samples a secp256k1 field element using the given secret via sample_field_element.
derive_own_key_share ๐Ÿ”’
Used in Proof of Relay to derive own half-key (S0) The function samples a secp256k1 field element using the given secret via sample_field_element.
generate_proof_of_relay
Helper function which generates proof of relay for the given path.
pre_verify
Verifies that an incoming packet contains all values that are necessary to reconstruct the response to redeem the incentive for relaying the packet.