Bitsquare Lending Facility

I would like to suggest the following, if say Bob needs to sell Bitcoin which he does not have, he needs to borrow the Bitcoin. Say Alice has Bitcoin that she does not plan to use for a period say 6 months. Alice can lend her BTC to Bob, in return for collateral say another coin or fiat. Bob can then sell the Bitcoin. At the end of the contract Bob returns BTC, Alice returns the collateral minus her fee.

Now if instead of collateral we do the following Alice sells the BTC together with a commitment to buy the BTC back at a future date at the same rate as today minus her fee. Nice thing about this is the payment Bob makes now, his collateral payment actually belongs to Alice. On the future date if Bob does not perform Alice can legally keep his collateral. And still sue him for non performance. Of course in reality she doesnā€™t actually know Bob so in practice she canā€™t sue. But at the future date Bob would be stupid to not deliver the BTC to get back his collateral if the BTC price had dropped. He would get back more than the BTC would cost to acquire. Of course if BTC had risen in price he will abandon the collateral. So what is required is that if the BTC price rises Alice will expect him to deposit the extra collateral, if he does not in a certain period of time, she can trigger that the contract is terminated, in this event she keeps Bobs collateral, which she then uses to buy BTC in the market. Since she can negotiate at the start, a buffer on the collateral she should make more BTC than she originally sold. The beauty of this ā€œbuy sell backā€ or ā€œsell buy backā€ mechanism is it can be easily implemented via smart contracts and requires no arbitration or multi sigs.

Each deal can be negotiated up front in terms of time and fees and excess collateral and triggers for collateral top up and timing for automatic termination.

Hi Doug,

thanks a lot for your interesting write-up!

I have a few questions and see a few concerns (maybe because of lack of details).

  • How high is the collateral (credit + interest?)
  • Is there a collateral for both? How to enforce that the lender follow the protocol (availability, sending the credit,ā€¦)?
  • As collateral currency is not the same as credit currency, how to deal with price volatility (can render collateral as too low)
  • If there are several arbiters, who has the right to issue the contract if there are timing issues (2 parties take the same offer at near same time)?
  • I assume the peers have to wait for at least 1 confirmation after the deposit, otherwise there is double spend risk
  • What if the lender never sends the money?
  • I assume the arbiter needs to be always online
  • If a peer is not online at the matching time, the deal will fail I assume.
  • I think there might be tricky cases where the collateral is already paid but then the peer is not available.
  • What if the arbiter is not online or does not fulfill his role?
  • What if the arbiter colludes with one peer?
  • Any more concrete ideas how the DAO would work?
  • How do the software agent resolve software bugs and usability problems (90% of all disputes in Bitsquare are in that area)?

I have the feeling the 3rd party arbiter as mediator in the process introduces more issues as it solves.
The positive might be that it mitigates the problem that the peers need to be online, though I am not sure if that is really fullfilled in that model.
But it introduces a new dependency that the arbiter need to be available and cooperate according to the protocol. So you have 3 cooperating entities.
A malicious party might abuse any moment when the symmetry of possible losses is not maintained by the collateral for blackmail (that is a main problem in any 2of2 MS schemes like Bitmarkets is using).

But my main concern is what are the use cases when the collateral as I assume will be min. the amount of the credit + interest rate?
If I have 100 BTC to put into collateral, I donā€™t need to borrow it.
If the use case is derived from the fact that the other currency might have a different price over the lending period, then I see even more problems with how to set the collateral correct to avoid that the contract will be broken.
I got quite a few disputes in Bitsquare in times with high volatility (Monero) that users preferred to cancel the trade and lose the low security deposit instead of fulfilling the trade contract to their disadvantage. So the price volatility of the counter currency can be a big instability issue.
My solution will be to make the security deposit adjustable by the offer maker in future so the risk can be adjusted by the maker. That leads to a kind of option trading where you get some hedge against too high volatility.

Br,
Manfred

Manfred,

(Sorry for the delayed response.) Iā€™ll try to address your questions as briefly as possible:

Q: How high is the collateral (credit + interest?)
A: Credit + interest + margin

Q: Is there collateral for both?
A: No. Collateral is only put up by the borrower. The arbiter software agent validates that the lender sent the funds to the borrower. This is determined by inspecting the flow of funds on the appropriate blockchain explorer. The software arbiter agent is a decentralized consensus mechanism.

Q: As collateral currency is not the same as credit currency, how to deal with price volatility (can render collateral as too low
A: The margin component of the collateral protects against deflation of the collateral currency vs the borrowed currency. If the borrowed currency drops in value relative to the collateral currency, there is an incentive for the borrower to repay in that the collateral has a higher value and it is to the benefit of the borrower to repay the loan to get back the higher valued collateral. On the other hand, if the borrowed currency increases in value relative to the collateral currency, an adjustment needs to be made (additional collateral deposited) to account for this and re-establish the balance in value. So an initial margin component is added to the collateral to attempt to account for this. It is not 100-percent as no one can predict the value of currency units once the loan has been made. The amount of volatility in cryptocurrency prices is a challenge to manage via a decentralized consensus mechanism due to response times ( canā€™t be done synchronously.) Iā€™m looking at a number of approaches to mitigate this risk but in concept, it is the same type of problem that centralized exchanges handle in their margin facilities. Bitcoin multi-signature addresses can accommodate multiple collateral deposits. It complicates transaction handling but could be utilized to provide incremental collateral deposits for decentralized margin calls. Decentralized margin calls will need more experimentation.

Bottom line is that volatility is always a risk that will need to be managed in the terms and conditions of the lending contract.

Q: If there are several arbiters, who has the right to issue the contract if there are timing issues (2 parties take the same offer at near same time)?
A: The arbiter is automated software code that performs arbitration through a Merkle DAG structure with digitally signed evidence of workflow and a decentralized consensus algorithm (in principle, similar to Bitcoin mining.) There is never a single arbiter processing the lending workflow. It is always a community effort when it comes to performing the work and distributing rewards.

Q: I assume the peers have to wait for at least 1 confirmation after the deposit, otherwise there is double spend risk
A: Correct. The collateral deposit is a Bitcoin (other collateral currencies will be added if they can support 2-of-3 multi-sig) 2-of-3 multi-signature transaction. Confirmations are handled just like other Bitcoin transactions. The borrowed currency (loan principal) transfer should follow confirmation procedures according to that currencies protocol recommendations.

Q:What if the lender never sends the money?
A: The collateral is returned to the borrower. And transaction fees are distributed in a way similar to the Bitsquare trading protocol to properly incent the involved parties (borrower + lender). Arbiter fees are distributed through the decentralized consensus algorithm.

Q: If a peer is not online at the matching time, the deal will fail I assume.
A: Short answer, no. The loan is modeled as a smart contract. There are defined response times that are specified in the contract and if those time limits are exceeded, then breach of contract terms are enforced. There is a bot interface that can always be running to provide for needed levels of automation to respond to defined events. So if the automated bot interface is not online or available, then yes the deal is at risk. The counter party must be present for the contract to be agreed to. I have focused on having the bot interface as a rule-based approach that will allow the contract to proceed without a human presence (manual acceptance). The contract terms and conditions are specified (no ambiguity) so that acceptance and execution can be automated to the greatest extent.

Q:I think there might be tricky cases where the collateral is already paid but then the peer is not available.
A: There are a lot of tricky cases. Iā€™m still working on continuous improvement in the prototype.

Q: What if the arbiter is not online or does not fulfill his role?
What if the arbiter colludes with one peer?
A: Again the arbiter is an automated, p2p decentralized consensus algorithm. Arbitration functionality is distributed across many peers. So colluding would require something like the Bitcoin mining >50% attack. Given that arbiter functionality is available on each and every node (even though it is on an opt-in basis) the expectation is an acceptable number of arbiters would always be online.

Q: Any more concrete ideas how the DAO would work?
A: At this point, it would be similar to Bitcoin mining rewards with the reward being the pool of fees paid on lending transactions. (There is no token or coin issued to users of the system. No new altcoin here.)

Q: How do the software agent resolve software bugs and usability problems (90% of all disputes in Bitsquare are in that area)?

A: This code will be open-source. So a development community would be responsible for handling software bugs. Very similar to how Bitsquare and others address these types of issues.

Iā€™ll provide additional details in the documentation that accompanies the prototype code. Once I have the code ready for others to inspect and stress test, I plan to create a project on github and start forming a community to extend the experiment.

regards,

Doug

1 Like

Manfred,

I neglected to address your questions following the bulleted list. Here it goes:

Regarding your statement:

But my main concern is what are the use cases when the collateral as I assume will be min. the amount of the credit + interest rate?
If I have 100 BTC to put into collateral, I donā€™t need to borrow it.
If the use case is derived from the fact that the other currency might have a different price over the lending period, then I see even more problems with how to set the collateral correct to avoid that the contract will be broken.

The key idea here is to provide a margin facility for decentralized exchanges like Bitsquare. If we are going to improve liquidity to compete with centralized exchanges, we will need to provide the ability to perform trades on the long as well as short side. Otherwise, we will not obtain a competitive advantage. Additionally providing a facility where traders can earn income (via lending) on idle funds, so much the better for business.

The key point is I have 100 BTC available for collateral purposes, I want to borrow ETH (or some other cryptocurrency), not borrow bitcoin! The bitcoin is for collateral to support decentralized lending amongst strangers. The collateral is the trust mechanism for the decentralized lending facility. Since the collateral is secured via a 2-of-3 Bitcoin multi-signature transaction, the borrower can rest assured that his collateral is adequately secured.

Example:

I may have 100 bitcoin that I want to save long-term. However, I am convinced that ETH is overvalued and I want to take advantage of that profit opportunity by selling ETH short. To do this I will need to borrow ETH (using my bitcoin as collateral because strangers shouldnā€™t trust each other), sell the borrowed ETH, then buy back ETH at a lower price, repay my loan + interest, keep my profit, and get back my valuable bitcoin (collateral) once the trade is complete. The lender earns interest and obtains repaid principal. A win-win if Iā€™m right.

If Iā€™m wrong, and do not want to loose my collateral, I will need to buy back the amount of ETH at market price to cover the principal + interest, and recover my collateral. In this case I lose, but the lender is made whole and paid the interest agreed to in the lending contract.

If I am wrong and default on the loan (donā€™t repay the lender), I lose my collateral (bitcoin) to the lender.

This lending facility will provide a new income stream with strong security measures (multi-sig) that does not currently exist. This would be a great incremental step to extending the cryptocurrency economy specifically targeted at true decentralized exchanges and begin to obsolete the riskier centralized models that exist today!

Does that make sense?

Doug

1 Like

ulysseus,

Iā€™m not understanding your suggestion. In your alternative scenario, how would Aliceā€™s commitment to buy the BTC back at a future date be technically implemented? Not a multi-sig?

How would your approach enable a margin facility for decentralized exchanges?

Iā€™m open to any better ideas!

Doug

shrike,

Thanks for your response. I plan to cover my base use case of decentralized lending for margin trading on decentralized exchanges. And put the code and docs out their to encourage other innovative ideas like yours.

Thanks again,

Doug

I have completed the 1st draft of the white paper which can be found on IPFS at:

https://gateway.ipfs.io/ipfs/QmWLagjWqHD4k9QPB9QJkfZWdTVLmStf7pqyjmLHPnoFZW

I also posted it to steemit: https://steemit.com/cryptocurrency/@douglasbebber/decentralized-lending-of-cryptocurrency

Please provide me with your feedback.

Doug

2 Likes