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.
Last updated
Was this helpful?
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.
Last updated
Was this helpful?
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).
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.
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
. The secretA1
is revealed when the Borrower withdraws the loan's principal.
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 nonce n+1
and amount = 0
to allow the Borrower to unlock the collateral once the payback is accepted.
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.
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.
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.
Actor: Borrower
Blockchain: Filecoin
Action: Unlock Collateral
Description: The Borrower uses secretB1
to redeem the (Unlock Collateral) voucher and close the payment channel.