Today we’re officially announcing support of the Lightning Network at Hodl Hodl. In this blog post you’ll find detailed information about:

What this is about;

When Lightning will be available at Hodl Hodl;

What’s under the hood.

Let’s get everything in order.

About

We’re one step away from introducing contracts on the Lightning Network at Hodl Hodl exchange. We believe this will solve the problems with transaction fees, speed up contract completion times, and will attract new users to the exchange.

When we implement Lightning Network to our exchange, every user will be able to buy bitcoins and receive them directly into their Lightning wallet & sell bitcoins directly from their Lightning wallet.

On the surface, the workflow remains almost the same:

The contract between buyer and seller is created; Seller deposits bitcoins from his Lightning wallet; Buyer pays the seller according to the agreed upon payment method; Seller releases bitcoins directly to the buyers Lightning wallet.

The differences are the following:

No payment passwords in Lightning contracts;

Every user that has traded at hodlhodl.com knows that we use payment passwords for depositing & releasing bitcoins from escrow.

In Lightning contracts, there won’t be payment passwords, since the funds are stored in our wallet, and no keys are required from users to make the release.

Buyer must enter the invoice in order to receive funds.

When buyer has made the payment to seller, he enters the invoice on the contract’s page, so seller can simply pay the invoice from our wallet, thus, releasing the funds.

That’s it — same as before, Hodl Hodl remains a P2P Bitcoin exchange, where you can buy & sell Bitcoin for any other currency (fiat & crypto), using any payment method, in any country in the world.

However, because there are currently no multisig escrow addresses on the Lightning Network, in order to introduce Lightning support, we don’t have any other choice but to hold the funds within the Lightning contracts.

We want to highlight, this ONLY affects contracts on the Lightning Network. In on-chain contracts, we still don’t have access to your funds & they’re stored in multisig escrow during the contract.

When

At testnet.hodlhodl.com, we will launch public testing of Lightning contracts on TESTNET at Hodl Hodl exchange at the start of May.

At hodlhodl.com, Lightning contracts will be available at the end of May.

What’s under the hood

In this part of the blog post, we’d like to explain more technical and specific details about our integration of the Lightning Network with Hodl Hodl & how the implementation works.

Let’s first discuss the user interface & how our customers will know whether they are trading on Lightning Network or the base chain.

When you come to hodlhodl.com

you will be able to set the exchange mode: Lightning or On-chain, simply by pressing the button in the header of the site, with the On-chain mode being set by default.

2. The difference between exchange modes

will be easy to see: when changed, the color of the exchange changes along with the logo.

In Lightning mode, the site is purple & our logo is lightning;

In On-chain mode, the site has a blue theme, with our standard logo.

3. In both exchange modes

you will be able to see the existing offers, create new offers & create contracts that are only dedicated to either Lightning Network or the base chain.

This is how it works: you just choose the site mode & you’re ready to go.

Now we want to delve deeper into the Lightning contracts workflow.

Contract creation

When the exchange mode is Lightning, the user navigates to the offer list & accepts one of the existing offers.

2. Seller deposits the funds

When the contract is created, seller has to deposit the funds directly from his Lightning wallet. As we have already stated, there are currently no multisig escrow addresses on the Lightning Network.

Therefore, in the Lightning contract, we automatically generate the invoice upon contract creation & seller simply sends the funds, by paying the invoice of the contracted amount. Seller sends the funds to our wallet only for the contract’s lifetime.

3. Buyer pays the seller

When the buyer sees that we have received funds from the seller (at this moment, the contract status changes), and he pays the seller according to the agreed upon payment method.

4. Buyer enters the invoice

When buyer paid the seller, buyer generates an invoice in his Lightning wallet, for the amount that we clearly indicate to him & simply enters it on the contract page.

In case the invoice expires, buyer always has the opportunity to update the invoice.

5. Seller makes the release

When seller sees that buyer has made the payment & entered the invoice (the contract’s status changes), seller is able to release the funds from our wallet directly to the buyers Lightning wallet.

6. That’s it, the contract is now complete!

Also, thanks to our Reddit post about the primary announcement, we know what things to highlight and what questions to answer.

People ask:

How does the escrow work?

Simply put, it does not exist — currently there are no escrow addresses on the Lightning Network.

On the contrary, in order to introduce Lightning support, we had set up our own LND node, through which we have our Lighting wallet. At the base of our node, we wrote our own library, which allows us to automate & secure the trading process, and roll out the implementation the way you see it.

Thus, when the contract is created, we automatically generate the invoice for the seller & he sends the funds to our wallet. When the contract comes to the end, we demand an invoice from the buyer, and for this invoice, seller can make the release from our wallet.

What are the reasons for separate listings of Lightning & On-chain offers?

We did not share the offer list. We separated the exchange modes for one simple reason: our customer’s convenience.

At first glance, this might seem strange, but we spent hours & days discussing and in consideration of different implementations.

Since Lightning is still in the early stages of the development, we decided to not shove everything in one pile, and to show the clear differences between Lightning and On-chain contracts at Hodl Hodl, as to not confuse our users.

What are the fees for Lightning contracts?

The fees for Lightning contracts are the following:

Exchange fee

Remains the same: maximum 0.6% per trade from the deposit amount.

Transaction fees

Are paid at two points: when the seller pays the invoice & when we pay the buyers invoice.

Due to Lightning Network specifications, the transaction fee amount must be included in the invoice sum. Therefore, when we are making the invoice for the seller, or demanding the invoice from the buyer, we always include the MAXIMUM possible transaction fee for the Lighting Network in the invoice sum.

This is done for the following reasons:

We don’t want a transaction to get stuck.

We understand that transaction fees can be smaller than the maximum one, however, setting a transaction fee other than the maximum carries a risk for stuck transactions.

To avoid this situation & to allow our customers to instantly trade, we’re setting the maximum txfee by default.

2. The maximum transaction fee on the Lighting Network is relatively small.

Do you hold the funds?

In On-chain contracts, as always on Hodl Hodl, we don’t hold the funds. During the contract, bitcoins are locked in the multisig escrow address, with 2 out of 3 keys needed for the release.

In the Lightning contracts, we hold the funds, but only for the contract lifetime. Currently, we don’t have any other choice than to do this, however, check the next paragraph, where we explain how we plan to avoid this.

Adding escrow to Lightning contracts

We said that currently there are no escrow addresses on the Lightning Network. However, we know that there is a protocol currently in development, known as HTLC, which allow to simulate the escrow work principle.

After we finish the current Lightning Network implementation, we’ll delve deeper into this subject.

Our nodes

We would appreciate it if you connected to both our testnet and mainnet nodes & create public channels with them in order to increase our inbound capacity.

Testnet node pubkey: 0316314db4eb542d17b9a7ac6f6651fcb319fd3da279197d4f09a890fc303ecf2d@178.63.16.7:9737

Mainnet node pubkey: 030bde3ee226b7cf456703811976e4241a929d11e5fc0549e9a1c6d10a8e23a738@178.63.16.7:9735

Thanks everyone

for your interest, support & belief in us. During the next week, we plan to announce the public testing of Lightning contracts at testnet.hodlhodl.com.

Reach us

Hodl!