registry/settlement

Responsibility

Settle permanent-retirement deposits and rejected-request refunds.

Dependencies

Uses duty, refusal, lib and ledger types; called by registry/modify.

Assumptions

Admission, trie moves and token duties have already held. Rejected rows carry positional refund floors in consumed-request order.

Invariants

Refund positions and per-payee sums both hold. Token carriers and the state continuation cannot also settle an owner’s separate obligation.

Functions

payeeFault(
  outputs: List<Output>,
  settles: fn(Output) -> Bool,
  owed: Pairs<PaymentCredential, Int>,
) -> Option<String>

Why an owner’s summed floor is not paid, or None. Outputs eligible under settlesOf count once toward their payment credential; short, misdirected or missing payments return deposit-returned.

refundFault(
  outputs: List<Output>,
  owners: Pairs<VerificationKeyHash, Int>,
) -> Option<String>

Why the rejected rows’ refunds are not paid positionally, or None (NOTE-014 item A2): the outputs after the state continuation, in the order the rows were consumed, each paying that row’s owner key at least what is owed. Unequal crossed allocations fail here even when every credential passes and every total matches. A short, misdirected or missing refund is deposit-returned, as for every other payment the fold owes an owner (#253).

payeeOwed(duties: List<Duty>) -> Pairs<PaymentCredential, Int>

Permanent-retirement deposit floors, summed per owner payment key.

settlesOf(
  cageCredential: PaymentCredential,
  duties: List<Duty>,
) -> fn(Output) -> Bool

Can this output settle an obligation of the fold? Off the cage’s own payment credential (the continuation sits there) and carrying none of the tokens the fold delivers, which owe their own deposits. Each output counts once toward its payee.

Search Document