Skip to content

💰 Repayment Path

The Repayment Path is the normal closure path of a dVault. It defines how BTC leaves the vault when the loan is repaid. There’s no bridge, contract, or wrapped asset - only a Bitcoin spend that becomes valid once the correct signatures are presented.

How It Works

  1. Debt Reduction
    • The borrower repays stablecoins (e.g., USDC) to the protocol treasury via the Repay() function.
    • The Execution Layer validates the transfer and updates the debtUsd field of the vault ledger.
  2. Collateral Unlock
    • Once the repayment is confirmed, a release signal is emitted for a proportional BTC amount.
    • Signers verify the repayment event and co-sign a spend via the Repayment ScriptPath inside the Taproot tree. They cannot trigger this spend independently - the borrower’s authorization is always required.
  3. Full Repayment
    • When total debtUsd = 0, the dVault can be fully unlocked.
    • The user + signer quorum co-sign the Bitcoin spend transaction.
    • BTC is returned to the depositor’s withdrawal address.

Script Anatomy

Each repayment branch commits the following tapscript at vault creation:

# User + signer network both must sign with their signature keys.
# The execution layer attests repayment but cannot move funds.
AND(
    OP_CHECKSIG(user_pubkey),
    OP_CHECKSIG(lin22_signer_set_key)
)

Repayment is the simplest — yet most important — path in Surge’s lifecycle, proving that Bitcoin can be used as dynamic collateral without leaving its native chain.