Highly volatile commodities and currencies pose a direct risk to a company’s profit margin. Successfully engaging in a business transaction with an extended time horizon is not only a question of financing the deal, delivering the goods and completing payment, but it is also a delicate balance of managing price risk. In the third part of this series we will explore how CommerceBlock can enable trust minimized hedging strategies on public blockchains with Bitcoin backed derivatives trading in the Lightning Network.

Multisignature smart contracts are a well known mechanism for managing the escrowed funds of counterparties engaged in a bet. The funds are deposited into a multisignature address and held there for the duration of the bet. When the bet has matured, the parties settle by constructing and signing a transaction that corresponds with the bet’s outcome.

On the Bitcoin blockchain, these bets would usually occur in a bare multisig or standard P2(W)SH output. While such a smart contract is generally acceptable for bets arranged over the counter, this structure is inherently constrained by the finite supply of block space. If instead the funds are locked in a multisignature Lightning Network compliant output script, the contexts in which the bets can occur become much more flexible and scalable. For example, the bets can be settled instantly, atomically swapped with one another and traded in high frequency. This combination of real world contracts and Lightning Network output scripts has been previously referred to as “in-channel” smart contracts. [0]

In discussions focused on “pegging” the value of one asset to another, contracts for difference (CFDs) often come up. The party who wants to peg their Bitcoin finds a counterparty who is willing to take a long bet on Bitcoin. The two parties put equal amounts of Bitcoin into a contract and agree on a maturation date and reference price feed. At contract maturation, the difference in price (represented in Bitcoin) is paid out depending on the price movement. If the price rises, the long position receives Bitcoin from the short and vice versa.

So long as the underlying asset’s price falls no more than 50% by the contract’s close, the short position walks away with the same amount of pegged value they came with. It is for this reason that CFDs and other combinations of options/futures/forward contracts have been described as giving the bettors the ability to “synthesize” one asset type from another. [1] What we will describe next is how these bets can occur in “in-channel” smart contracts through an exchange that doubles as an intermediary Lightning Network node between counterparties. [2]

One of the established benefits of using public blockchains is the reduced counterparty risk. You can hold your own Bitcoin and be responsible for your own security. However, when you want to actively trade against the markets you have to enter into a custodial agreement with an exchange. They promise to keep your funds safe and you pay them to use their exchange service. If your funds are stolen you may or may not have any recourse.

With CommerceBlock infrastructure it will be possible to design an exchange that does not hold customer private keys but still enables bets of digital bearer assets to be matched, routed and novated at high speed. Instead of depositing funds into the exchange’s hot wallet, the bettors and lenders open payment channels with the exchange; consequently, all potential counterparties are just one “hop” away from each other.

In this example, you have a number of parties: a short position and a basket of longs. The short position posts an order for for 1 BTC. The long position can be sold in tranches, bringing the total BTC in this bidirectional multihop payment channel to 2. The bets in this channel are managed by a 2 of 3 multisig, with one key controlled by an m of n threshold of Discreet Log Oracles and the other keys held by bettors. At contract maturation, the DLOs will sign the price and those signatures will be used to blindly settle the funds. While the contract is in flight, it would be possible for a counterparty to novate with an atomic swap. Because the long position in a CFD has wipeout risk, it is assumed traders would also use the exchange to implement a collar strategy for risk constrained profit maximization.

There is quite a lot of potential here and CommerceBlock is excited to research and develop in this area. We are just starting to scratch the surface!

CommerceBlock is creating a decentralised finance network, join us on Telegram!