Lend ERC20 Tokens - FIL as Collateral
In this section we describe the process to enable the creation of native to native debt instruments across blockchains with ERC20 tokens as principal and FIL as collateral.
FIL backed ERC20 Loan
Normal Flow
Step 1: Create Loan Offer
Actor: Lender
Blockchain: Ethereum (or EVM compatible blockchain)
Action: Create Loan Offer
Description: The Lender creates a loan offer and funds the loan offer with the principal (ERC20 tokens).
Step 2: Create Payment Channel
Actor: Borrower
Blockchain: Filecoin
Action: Create a Payment Channel to the Lender's FIL address.
Description: The Borrower creates a Payment Channel to the Lender's FIL address to lock the required collateral.
Step 3: Create (Seize Collateral) Voucher
Actor: Borrower
Blockchain: Filecoin
Action: Create Voucher
Description: The Borrower created a Voucher to allow the Lender to seize the collateral in case of default. The Voucher can only be redeemed by the Lender by using the
secretA1
. ThesecretA1
is revealed when the Borrower withdraws the loan's principal.
Step 5: Approve Request & Sign (Unlock Collateral) Voucher
Actor: Lender
Blockchain: Ethereum (or EVM compatible blockchain)
Action: Approve Request & Sign Voucher
Description: The Lender assigns the Loan to the borrower by entering the Borrower's ETH based address and hashed preimage (
secretHashA1
). Afterwards, the Lender signs a voucher with noncen+1
andamount = 0
to allow the Borrower to unlock the collateral once the payback is accepted.
Step 6: Withdraw Principal
Actor: Borrower
Blockchain: Ethereum (or EVM compatible blockchain)
Action: Withdraw Principal
Description: The Borrower withdraws the Loan's principal from the smart contract by revealing the
secretA1
. This secret allows the Lender to seize the collateral if the Borrower fails to pay back the loan on time.
Step 7: Repay Loan
Actor: Borrower
Blockchain: Ethereum (or EVM compatible blockchain)
Action: Payback
Description: The Borrower pays back the loan's principal plus interests before the loan expiration date by sending the ERC20 token amount to the smart contract.
Step 7: Accept Payback
Actor: Lender
Blockchain: Ethereum (or EVM compatible blockchain)
Action: Accept Payback
Description: To accept the Payback, the Lender reveals
secretB1
which allows the Borrower to redeem the (unlock collateral) voucher and settle the payment channel.
Step 8: Unlock Collateral
Actor: Borrower
Blockchain: Filecoin
Action: Unlock Collateral
Description: The Borrower uses
secretB1
to redeem the (Unlock Collateral) voucher and close the payment channel.
Last updated