Skip to main content

Module transfer

Module transfer 

Source
Expand description

Transfer requests: what a holder signs to hand notes on.

A transfer consumes input notes and asks the issuer for new notes, bound to the receivers’ one-time keys. The holder of every input signs one message that names all inputs and all outputs:

b"worgl/transfer/v1" ‖ issuer key (32)
  ‖ input count (u32) ‖ for each input:  generation (u64) ‖ index (u32)
  ‖ output count (u32) ‖ for each output: amount (u64) ‖ holder key (32)

All integers are big-endian. Because the message names the outputs, nobody who sees a request in flight can redirect the money, and because it names every input, signatures cannot be moved between requests. Anyone may submit a signed request: the payer, or the payee the payer handed it to.

The SHA-256 of the message is the request’s TransferId. The issuer uses it to recognise a resent request and answer it with the same notes.

A BurnRequest destroys notes on purpose, for a service that consumes the tokens it is paid. Its holders sign a message under a different domain, so a burn signature never passes as a transfer’s or the reverse:

b"worgl/burn/v1" ‖ issuer key (32)
  ‖ input count (u32) ‖ for each input:  generation (u64) ‖ index (u32)

Structs§

BurnRequest
A signed request to destroy inputs, issuing nothing in their place.
Output
A note to be created by a transfer.
Spend
An input note together with its holder’s signature over the transfer.
TransferId
SHA-256 of a transfer’s or burn’s signed message. Two requests with the same id spend the same notes into the same outputs.
TransferRequest
A signed request to consume inputs and issue outputs.
VerifiedBurn
A burn request whose signatures and shape have been checked.
VerifiedTransfer
A transfer request whose signatures and shape have been checked.
Verifier
Checks requests against one issuer’s keys and policy.