"Jane creates a loan application" - Gingeropolous/DAFNE GitHub Wiki

“Jane sends out a loan application”

Ledger entry (the below are column titles, because I was once told that computer code likes wide files as opposed to tall files. But anyone probably has a better grasp on data structure than I do)

  • [Contract identifier]
  • [Contract type] (0 for crypto, 1 for fiat-crypto hybrid)
  • [Fulfilled status] ( 0 or 1)
  • [Verification]
  • [Disbursement status]
  • [Contract address] (address that will receive funds)
  • [request amount]
  • [interest offered]
  • [repayment term]
  • [loan information]
  • [stake 1]
  • [stake 2]
  • [stake 3]

… etc

The stake field is multipart, and is delimitted

A.B.C.D.E.F

A is stake type. Currently 0 for loan, 1 for grant

B is First percentage. Values are 0-100

C is stake amount

D is lendwallet address

E Unix Time timestamp

F Is status. 0 for active, 1 for inactive (might also be able to deal with stake pulls by using - transaction amounts)

So, if someone comes in and stakes in standard loan form, wants 50% of First, and wants 2 BTC stake in loan, then

0.50.2.E09823jbrf87329i53kj209fwkjboij9843.1418604317

would be the entry.

In the client software, the program interprets the entries in the ledger. Mainly the program calculates how much of the stake and First remain, and it displays these.

When the remaining stake reaches 0, the fulfilled status is set to 1. This information would cause all committed transactions to be locked. Up until this point, stakes can be pulled.

In the node software, at the interface between the Loanchain and the Blockchain is a separate daemon that monitors the loanchain . Every time a block is made that contains a completed contract (assessed by reading a specific contract identifier and the fulfilled status field) the [Verify] counter is increased by 1.

When the Verify counter hits 6, the program submits the transaction to the BTC network.

Payments are performed by a payment daemon, and we must find a way where the Loanchain network won’t pummel the BTC network with duplicate transactions. Well, the person that solves the latest block will be the node that ultimately modifies the verify counter. This node is then the one that broadcasts to the BTC network.