Loan Assignment
Loan Assignment
The Borrower sends a loan request to the Lending Contract to initiate a loan.
The Lending Contract then assigns a unique vault, the Collateral Vault, for the loan. Expressed in a Miniscript-like pseudocode, the lock script for this vault is as follows:
The Collateral Vault serves as the foundation for all collateral-related operations. In this paper, we will examine each spending condition in detail. For now, here are some initial observations to help build understanding.
The DCM multi-sig participants are indexed from 0..n, with a threshold T of signatures required to spend.
The aggregated adaptor signature setup in the script above merits further examination. We can formally describe the Adaptor Signature process as follows. Let λ represent the secret scalar, and G be the base point of the elliptic curve. The adaptor point A is computed as A = λG. Let m denote the message, which is pre-signed signature of Bitcoin transaction: m = sig_hash(psbt)
Given a private key sk and the adaptor point A, we define the adaptor signature σ_A = SignAdaptor(sk, m, A).
The function SignAdaptor represents the cryptographic operation to create an adaptor signature. To redeem the signature, we use the secret λ to adapt σ_A, producing the final signature σ = Adapt(σ_A, λ).
In this formulation:
λ ∈ Zq (the scalar field of the curve)
A, G ∈ E(Fq) (points on the elliptic curve)
m ∈ {0,1}^256 (256-bit hash output)
σ_A, σ are elements of the signature space
In summary, from the Bitcoin chain’s perspective, the resulting signature appears as a standard Schnorr signature. However, this scheme modifies the signing process to produce a special adaptor signature, which can embed a secret to be revealed at a later stage. This adaptor signature enables trust-minimized loan repayment by leveraging Scriptless Scripts within the Bitcoin framework.
The Lending Contract also needs to compute the interest and liquidation price based on the current price and pre-allocate funds for this loan, representing it as the Loan Request:
If the Borrower accepts the loan terms, they proceed by transferring the BTC collateral to the assigned Collateral Vault. Once the deposit is confirmed and verified on the Side Chain, the Lending Contract generates three CETs, which are then co-signed by both the Borrower and the DCM. These CETs correspond to the possible settlement outcomes of the loan agreement:
Default Liquidation CET: executed if the loan reaches maturity without repayment.
Price Liquidation CET: triggered if the attested BTC price falls below the liquidation threshold.
Repayment CET: executed upon successful loan repayment, releasing the collateral back to the borrower.
In code, the adaptor signature generation process is as follows:
The Borrower then submits the CETs and corresponding adaptor signatures to the Lending Contract on the Side Chain in order to claim the loan assets (e.g., USDC).
At this point, the collateral is securely locked in the Collateral Vault, and the Borrower has successfully received the loan. The Borrower may choose to repay the loan at any time prior to the Maturity Date.
Last updated