Secrets - AtomicLoans/atomicloans-rfc GitHub Wiki

The secrets used in the lending/borrowing portion of the protocol are as follows:

  • Secret A1
    • Used to prove that Alice withdrawn the loan. Revealed on Loans.withdraw
  • Secret B1
    • Revealed by Bob when they wish to allow Alice to retrieve her Collateral after repaying the loan by calling Loans.accept.
  • Secret C1
    • Revealed by Carol when they wish to allow Alice to retrieve her Collateral after repaying the loan by calling Loans.accept.

The secrets used for liquidations are as follows:

  • Secret A2
    • Revealed by Alice after 30 minutes after Carol has provided a signature for the collateral swap p2sh to return to the collateral p2sh if Bob has not revealed Secret B
  • Secret B2
    • Revealed by Bob after Carol has provided a signature for the collateral swap p2sh to return to the collateral p2sh (within 15 minutes)
  • Secret C2
    • Revealed by Carol after Bob has provided a signature for the collateral swap p2sh to return to the collateral p2sh (or Alice if Bob has not responded for 30 minutes).

Note: When requesting a loan, each party provides 4 secret hashes. 1 for the lending/borrowing portion of the debt agreement, and 3 to allow for up to 3 liquidations to occur, in case the first 2 fail.