Banco: Non-Interactive Swaps
We are excited to introduce Banco, a Bitcoin trading protocol that facilitates non-interactive swaps among two or more parties utilizing Elements introspection opcodes.
Discover more about the protocol or start trading on the Liquid Testnet at banco.vulpem.com. Additionally, you have the option to host your Banco server to contribute liquidity.
What’s the Deal?
Non-interactivity is a sought-after feature in atomic swaps and various decentralized protocols. Over time, it has become clear that interactivity and state management can hinder the adoption of self-custodial applications in real-world scenarios. Existing alternatives often rely on co-signing schemes, necessitating participants to be online and accessible over the public internet, which compromises the privacy and user experience of trading participants.
Banco’s protocol eliminates the need for a trusted third party. It offers a non-custodial solution for traders and is capital-efficient for market makers, eliminating the necessity for a centralized order book and settlement server. Liquidity providers can deploy a straightforward automated bot that monitors the mempool for pending contracts to execute or via recursive covenants constructions to enable automated liquidity pools.
How Does This Benefit Bitcoin?
Banco enables BTC-to-BTC trades. Unlike current coinjoin schemes, which are highly interactive and require the use of specific wallets, Banco simplifies the process. It significantly expands the pool of potential liquidity providers; anyone can operate a taker bot or contribute to a covenant pool, fostering liquidity in an open and borderless network.
Design Goals
- Confidentiality: The protocol ensures confidentiality by default, allowing traders and providers to engage without disclosing their intentions publicly.
- Ease of Integration: The protocol is user-friendly and does not demand specific wallet integrations. Traders can fund trade contracts using any wallet that supports Taproot addresses.
- Liquidity Efficiency: Traders can initiate transactions that any liquidity provider can fulfill, provided the trader doesn’t cancel the transaction. This feature enables liquidity provision through automated bots, mitigating the risk of capital being locked for extended periods, as seen with time-locked atomic swaps.
- Decentralization: Banco is entirely decentralized, requiring no trusted third parties. It is non-custodial for traders and capital-efficient for market makers, without the need for centralized order book servers or settlement facilities. Takers can simply monitor the mempool for public contracts to fulfill.
- Operational Security: The protocol allows providers to operate in a pub-sub manner, monitoring a public channel (e.g., the mempool or Nostr) and broadcasting the spending transaction to execute the trade, eliminating the need for firewalls or publicly accessible IPs.
How It Works
Banco requires two blockchain transactions: one to fund the trade contract and another to either fulfill or cancel it. The trader (from now on the maker) can utilize any wallet to send and receive assets, while the provider (the taker) is an automated bot that executes trades by crafting fulfill transactions, incorporating funds to cover the trade amount enforced by the covenant in the trade contract.
The maker initiates by funding a trade contract, which a taker can fulfill without further input from the maker. The contract mandates that the first output of the spending transaction matches the requested value, asset, and script.
Once this funding transaction is visible in the mempool or shared privately, the taker can execute the contract by sending a fulfill transaction that spends the funding transaction’s output, adhering to the covenant’s constrained value, asset, and script.
Should the maker opt out of the trade, they can cancel the contract, a privilege exclusively held by the maker. Canceling involves sending a transaction that reverts the funding transaction’s output back to the maker.
Show Me the Opcodes
OP_0
OP_INSPECTOUTPUTSCRIPTPUBKEY
<MAKER_WITNESS_VERSION>
OP_EQUALVERIFY
<MAKER_WITNESS_PROGRAM>
OP_EQUALVERIFY
OP_0
OP_INSPECTOUTPUTASSET
OP_DROP
<MAKER_ASSET_TO_RECEIVE>
OP_EQUALVERIFY
OP_0
OP_INSPECTOUTPUTVALUE
OP_DROP
<MAKER_VALUE_TO_RECEIVE>
OP_EQUAL
Roadmap
- Integrate within Marina Wallet with a Swap interface.
- Automated trading pool that fulfills trades using a recursive covenant and oracle signed price attestations.
- Develop gRPC and JSON APIs for Banco server interaction.
- Enable Confidential Funding for confidential transactions.
- Utilize Nostr for public trading and Nostr DM for private exchanges.
- Investigate shared-secret generation for blinding factors in fulfill transactions.
Contribute
Banco is open-source, with a server reference implementation available on GitHub at https://github.com/vulpemventures/banco.