Module tuxedo_core::verifier

source ·
Expand description

A verifier is a piece of logic that determines whether an input can be consumed in a given context. Because there are multiple reasonable ways to make this decision, we expose a trait to encapsulate the various options. Each runtime will choose to make one or more verifiers available to its users and they will be aggregated into an enum. The most common and useful verifiers are included here with Tuxedo core, but downstream developers are expected to create their own as well.

Structs§

  • Allows UTXOs to be spent when a preimage to a recorded hash is provided. This could be used as a puzzle (although a partial preimage search would be better) or a means of sharing a password, or as part of a simple atomic swapping protocol.
  • Pay To Public Key Hash (P2PKH)
  • Require a signature from the private key corresponding to the given public key. This is the simplest way to require a signature. If you prefer not to expose the public key until spend time, use P2PKH instead.
  • A testing verifier that passes or depending on the enclosed boolean value.
  • Allows UTXOs to be spent after a certain block height has been reached. This is useful for locking up tokens as a future investment. Timelocking also form the basis of timeout paths in swapping protocols.
  • A simple verifier that allows no one to consume an output ever.
  • A simple verifier that allows anyone to consume an output at any time

Traits§

  • A means of checking that an output can be spent. This check is made on a per-output basis and neither knows nor cares anything about the validation logic that will be applied to the transaction as a whole. Nonetheless, in order to avoid malleability, we we take the entire stripped and serialized transaction as a parameter.