Sitemap

Hodl Hodl Escrow API

5 min readSep 24, 2019

--

As you may have heard, last week we made two major announcements at the 2019 Baltic Honeybadger conference in Riga: generic escrow contracts with an API, and open sourcing our Exchange project. Explaining everything precisely and in a way that’s well understood within the timeframe of a 20 minute talk was challenging, so we wanted to write two detailed blog posts to explain each of those announcements and share more details.

The first post is about the Escrow API

Currently, Hodl Hodl as a company, has two major projects: Exchange and Predictions. Both of those projects use Bitcoin’s multisig feature, allowing the two parties participating in an Exchange or Predictions contract to deposit bitcoins into a special escrow address (p2sh address) from which the bitcoins can only be released by a transaction which requires 2 out of 3 keys to sign it. Two of those three keys belong to the counterparties and are generated in the browser — Hodl Hodl does not know those keys and is unable to use them. One of those three keys belongs to Hodl Hodl, and Hodl Hodl can use that key to sign the release-from-escrow transactions together with one of the counterparties. This scheme facilitates safe trades on the Exchange platform and safe contracts on the Predictions platform. It also makes Hodl Hodl a de-facto non-custodial exchange, because it cannot unilaterally move bitcoins from the escrow address to anywhere else.

The realization that we came up with some time ago, was that we can employ the same Bitcoin multisig escrow scheme in creating a generic version of a multisig contract, which can be used not only to Exchange bitcoins into fiat or make a prediction, but to provide a safe tool for any kind of contract where escrow is required. We can also improve the current scheme in such a way that an arbitrary number of keys is used (not just 2 out of 3, but n out of m), and also make it possible for Hodl Hodl to NOT to hold any of those keys, shifting that responsibility to a third party, most likely a market operator, responsible for connecting the counterparties and handling potential disputes between the users.

The very same generic contracts will also use Lightning Network instead of Bitcoin multisig, while providing an almost identical UI (as is currently the case on Hodl Hodl exchange, which also allows Lightning trades), it will handle Lightning Network escrow in these contracts, so users will have an opportunity to pick the version (on-chain Bitcoin or Lightning Network) that is most relevant for their use case.

We also realized we can provide a simple API that third-parties connecting various other counterparties can use to easily create and monitor contracts for their users. The API will provide an SDK in Javascript (and, possibly, some other languages), which will give the third-party the ability to generate escrow-addresses and release bitcoins from escrow without the need for manual input (programmatically, that is).

What this all means is that if you’re wanting to build a service that uses Bitcoin or Lightning Network escrow, you don’t need to learn the Bitcoin protocol or Lightning network protocol, you don’t need to hire Bitcoin or Lightning developers, you don’t need to take care of the updates and test your service for vulnerabilities. All you need is to integrate a simple API.

This opens up Bitcoin and Lightning Network to many different use cases. For example, it will become possible to create:

  1. Your own OTC desk. Using our escrow API it becomes possible to
  2. Control the process of creating offers & contracts
    (you hold the 3rd key to escrow)
  3. NOT waste resources creating your own infrastructure for generating & storing keys and processing transactions.
  4. NOT waste resources creating your own contracts UI
  5. Improve your security by using our NON-CUSTODIAL solution — because these days everyone knows that holding bitcoins in a wallet (as opposed to using multisig escrow) is much more prone to attacks and is much more likely to lead to loss of bitcoins.
  6. Use your own KYC/AML policies — if you have those and your customers don’t mind — great. If you don’t and know how to handle it — also great. Because we’re not holding any of the keys and we’re just providing a technical solution, we don’t really care
  7. A prediction market or p2p betting market. While Hodl Hodl recently launched the Predictions project, we also recognize the need for more specialized solutions. Perhaps you know your domain better and want to tailor UI/UX for your particular group of users. You can build your own app, but still use our escrow API.
  8. A gaming payment/escrow solution. Games and payment processing in games is a big deal as these days most online games introduce their own in-game currencies. The problem is that they still use traditional payment methods to get money in and out, and it’s a huge hassle when you have a global user base. Escrow API can easily be adopted for usage in gaming platforms.
  9. A real-estate market, a car-market, and a virtual-goods market — in other words, an asset-market.
  10. A service market such as a freelancer market, shipping market, or knowledge sharing market.

When you build using our escrow API, you will also be earning commission on every completed contract your users create (and you’ll be able to set your own fees!).

As if this wasn’t good enough, you won’t actually need to integrate our API or know any programming to make use of generic escrow contracts — if you just want to occasionally create escrow contracts for your users, you’ll be able to do so using a simple UI in the browser. This is actually the use case for small OTC desks: Hodl Hodl recognizes they might not actually be willing to use Hodl Hodl Exchange (which does hold one key, and forces a certain workflow upon every user) and might instead want to control that extra key themselves, while also tweaking the contract workflow and statuses to their liking — now they’ll be able to. In fact, if your current OTC desk operations are small, but you expect growth, you can start using a simple in-browser UI, provided by Hodl Hodl, to create and control escrow contracts, and later build your own fully functional custom Bitcoin exchange — all with our API and without having to know or worry about the details of Bitcoin or Lightning Network protocols.

If you’re interested in using our generic escrow contracts and/or API, please reach out to escrow-api@hodlhodl.com and provide more details about your use case. Right now, you have a unique opportunity to influence what gets to be in the first release and shape the future of the product.

Hodl!

--

--

Hodl Hodl
Hodl Hodl

Written by Hodl Hodl

P2P Bitcoin trading & lending platform that doesn’t hold user funds

No responses yet