Decentralized Finance (DeFi) has revolutionized the crypto world, propelling Ethereum to become the second-largest blockchain after Bitcoin. However, what many are unaware of is that DeFi is also growing and thriving on the Bitcoin network.
In this article, we look at Discreet Log Contracts, a new mechanism for building scalable smart contracts on top of Bitcoin. Read on to learn how this technology could further expand DeFi on Bitcoin.
What Are Discreet Log Contracts (DLCs)?
A Discreet Log Contract (DLC) is a type of Bitcoin transaction that utilizes an oracle to execute smart contracts on the Bitcoin blockchain. Think of them as a type of smart contract for Bitcoin.
An oracle is a code programmed into blockchains like Bitcoin to help extract information from off-chain sources like databases. Therefore, DLCs enable two parties to create and execute private agreements off-chain, with the Bitcoin blockchain acting as the final settlement for the agreements.
Discreet Log Contracts were first introduced as a theoretical concept in Thaddeus Dryja’s whitepaper back in 2017. However, their practical implementation only became feasible after the groundbreaking work of Loyd Fournier on adaptor signatures. Adaptor signatures enable the creation of scripts that don’t rely on Bitcoin’s Script programming language, a feature often called “scriptless scripts.”
Adaptor signatures facilitate the execution of complex contract terms without revealing sensitive details on the blockchain. This ensures that the privacy of the contract remains intact, with only the final settlement outcome being recorded on the public ledger.
How Do Discreet Log Contracts Work?
Now, let’s take a look at how DLCs function.
- Contract Creation: Two parties come to an agreement on the terms of a contract. The contract could be anything that’s contingent on a specific event or outcome. For instance, a bet on a sports match, a financial derivative, or an insurance agreement.
- Oracle Selection: The parties choose an oracle to determine the outcome of the contract. The oracle should be a source that neither party controls and that both parties trust to report accurately on the outcome. The oracle generates a set of possible outcomes, each associated with a unique signature.
- Transaction Construction: Using these signatures, the parties construct a set of transactions, each corresponding to a possible outcome. These transactions are not yet valid because they lack the oracle’s signature.
- Funding Transaction: The parties create and broadcast a funding transaction to the Bitcoin blockchain. This transaction locks up the funds that will eventually be paid out according to the contract’s outcome.
- Contract Execution: When the event occurs, the oracle broadcasts the relevant signature corresponding to the outcome. The parties can now each generate a valid transaction by combining this signature with the incomplete transactions they created earlier.
- Settlement: The party who won according to the contract’s terms broadcasts the completed transaction, thus claiming their funds. The Bitcoin blockchain acts as the settlement layer. Throughout this process, the details of the contract itself never appear on-chain, and thus remain private. Additionally, the oracle doesn’t know which particular contracts use its data, providing an extra layer of security and privacy.
An Example of a DLC
If two parties are betting on a sports match, the condition could be picking the winning team, and the time for executing the contract could be ten minutes after the game ends. Once the terms are agreed upon, they lock their bets in a special wallet called a multi-sig wallet. This wallet requires multiple parties’ signatures before the funds can be released.
The next step is to choose an oracle or even a group of oracles. An oracle will determine the outcome of the bet. Usually, this source of information is found off-chain. It could be a website that publishes match results or an exchange that provides the price of an asset.
Note that the oracle doesn’t need to know any details about the bet or even who is involved in a Discreet Log Contract. Its work is strictly limited to providing the outcome of the results. The oracle is specified in the contract, together with the conditions for determining the outcome and the time when the parties will know the result. Once the event takes place, the oracle publishes a cryptographic proof called a commitment that shows it has determined the event’s results.
To claim the funds locked in the multi-sig wallet, the winning party uses the commitment provided by the oracle to create a valid private key that allows them to sign a transaction that spends the funds from the wallet. This transaction is then added to the Bitcoin blockchain, making it final and secure.
Below is a graphical illustration of the concept.
DLCs are more private than other oracle-based smart contracts because, in these instances, the oracle only signs a message that a certain outcome occurred as opposed to signing transactions like in DLCs.
Furthermore, the transactions involved in creating and settling DLCs look similar to other regular Bitcoin transactions, making them indistinguishable and preserving privacy. Lastly, DLCs are more scalable since only the final settlement is recorded on-chain.
DLC Use Cases
Discreet log contracts have a big potential to unlock the full potential of the Bitcoin blockchain and position it as a fully-fledged web3 platform. The following are a few prominent use cases for DLCs:
Decentralized Finance (DeFi)
DLCs enable the creation and execution of smart contracts representing any number of underlying assets, for example, a futures contract on the price of bitcoin. This is as long as a secure and trustworthy price feed oracle is available. DLCs could establish a thriving ecosystem of futures contracts on the Bitcoin blockchain.
Insurance
DLCs provide a framework that requires minimal trust to operate, which may be utilized to address the issue of information parity in the insurance industry.
Sports Betting
DLCs have the potential to revolutionize peer-to-peer sports betting on the Bitcoin network by empowering individuals to participate in secure and private sports betting activities by eliminating intermediaries.
Conclusion
Discreet log contracts open up new opportunities for innovation, privacy, and efficiency on the Bitcoin blockchain.
Through oracles and smart contract technology, DLCs enable private and secure agreements to be executed off-chain, with the Bitcoin blockchain serving as the ultimate settlement layer. As the technology continues to grow, we expect it to expand the capabilities of decentralized finance on the Bitcoin blockchain.