Skip to content

Intro to XO - The Why and the What

You may have heard about XO, General Protocols’ project that promises to make it easy for developers to create superior Bitcoin Cash applications. But what is it, actually? And why do we need it?

The problems to be solved

The Bitcoin Cash (BCH) blockchain has undergone several groundbreaking protocol upgrades in recent years. These upgrades made it possible to build complex and innovative decentralized financial applications (or “dapps”) using Bitcoin Cash smart contracts.

But building and interacting with BCH applications is still relatively difficult for software developers. The process requires esoteric knowledge about Bitcoin Cash’s protocol, and it often involves writing an entire wallet application around a dapp. This is a huge burden for app developers, and it’s also a suboptimal experience for users, who are forced to keep track of more and more wallets.

The Wallet Connect protocol lets a user interact with a decentralized application using their personal wallet, but that workflow has its own problems. In that case, the dapp provides the wallet with transactions to sign, but there is no guarantee to the user that the provided transaction does what the application says it does. The user is forced to trust a third party when using dapps because their wallet doesn’t understand how the decentralized application works, and so it can’t verify anything itself. This is a serious security risk.

Additionally, when a wallet doesn’t understand a decentralized application, it can’t keep track of the data needed to continue interacting with that application. For example, to use a derivatives application like BCHBull, you need to hold on to the data used to create the contract: the price source, leverage amounts, and position amounts. This contextually relevant data is called “state” and, in many cases, losing access to state means losing access to your funds, since you won’t be able to construct the transactions that withdraw or claim the BCH that is tied up in your contracts. Once again, users are forced to trust a third party.

Enter the XO Stack

What’s needed to address these problems are software tools and standards that allow wallets and applications to coordinate in a safe, private, and user friendly way. That’s what General Protocols is building with the XO stack.

Templates

The first fundamental pillar of the XO Stack is the concept of templates. A template is a description of a Bitcoin Cash use case in a standardized format. It includes the use case’s different participants, what actions each participant can take, what state must be kept track of, as well as human readable descriptions of all data.

A template-aware wallet can take a template and some contextual data as input and then construct the required transaction(s) independently. This on its own is a huge step forward, but it’s important to understand that this does not completely remove trust from the equation. Instead, it moves the trust from the app to the templates themselves. While a template-aware wallet can use a template to infer what it needs to do to complete an action, it can’t verify that the human readable descriptions are accurate, or determine whether a resulting action is something a user would actually want to do.

So wallet developers and users must decide which template sources to trust. A wallet developer may pre-approve a select few well known and vetted templates, for instance, an Anyhedge template (Anyhedge is the protocol used by BCHBull), or a Pay to Public Key Hash template (for simple sends). Then, if their wallet allows adding custom trusted templates, a user might decide to add several decentralized exchange templates to their wallet’s trusted list, so that they can trade between Bitcoin Cash and fungible tokens, or add funds to liquidity pools. It’s critical, however, that a user treats new or unknown templates with extreme caution.

Once a trusted set of templates is established, the benefits follow. Any application that makes use of those templates can pass the transaction construction responsibilities on to your wallet without any additional trust required. For example, you could use any number of different dapps that use the Anyhedge protocol to provide derivatives products, or you could use various decentralized exchanges that use the same swap and liquidity pool protocols. In each case, your wallet will be able to provide human readable descriptions of the actions you’re taking, allowing you to check that an application is doing exactly what it says it’s doing. This is still important because, while your wallet can verify the app is using a trusted template, it doesn’t necessarily know what values you entered in the application’s user interface!

The XO Engine

This templating system has enormous benefits for users when it comes to safety and ease of use. But with all of Bitcoin Cash’s newly unlocked smart contract capabilities accessible via the template standard, developers will need sophisticated tools to manage that complexity. That’s where the XO Engine comes in.

The XO engine is the workhorse and personal Bitcoin Cash expert that handles all the low-level details for developers. It’s responsible for interpreting templates, managing cryptographic keys, tracking state, generating invitations, constructing transactions, and more. When using the XO stack, developers only need to familiarize themselves with how to make high-level requests of the engine, and the rest is taken care of for them. This massively reduces development time, cost, and risk of safety-compromising programming errors.

Onward with XO!

The Bitcoin Cash protocol is in an excellent position regarding its technical capabilities. We at General Protocols are excited to bring Bitcoin Cash infrastructure up to speed, making powerful BCH apps easy and intuitive to develop with the XO Stack. We also continue to design and develop our premier XO App, the XO Wallet. With the full power of Bitcoin Cash under the hood, the XO Wallet promises to be an essential part of a brand new ecosystem of apps, developed by General Protocols and others. Keep your eyes open for more XO-related content as we build the future of programmable money!