emj
shrx

Reference · Glossary

Supporting covenants

Small Simplicity programs the main LendingOffer covenant composes with. Source: simplicity-lending simf.

CovenantRole in lending
ScriptAuth Locks the lender NFT to the LendingOffer script hash. Unlocks when the parent covenant spends (e.g. accept). Prevents lender NFT moving independently before acceptance.
AssetAuth Locks principal to the borrower NFT until conditions met. On accept, borrower’s principal output is wrapped in AssetAuth.
AssetAuthVault Holds repaid principal. Keeper NFT (lender or protocol) authorizes withdrawal; supplier NFT (borrower) governs deposits during repayment. Active vs finalized variants.
IssuanceFactory Mints per-offer utility NFTs (Lesson 2).
LendingOffer Main lifecycle covenant: pending → active → repay / liquidate / cancel.

How they chain (accept example)

  1. Spend pending_offer with OfferAcceptance witness
  2. Co-spend lender NFT via ScriptAuth unlock
  3. Update storage: is_active = true
  4. Create new active_offer output + AssetAuth principal for borrower

PR #13 wires these for pending creation only (ScriptAuth.attach_creation for lender NFT). Accept/repay paths come in later PRs.