Try ALEX Bitcoin DeFi Now →
Blog
/
Educational
What is a Bitcoin Oracle?
December 3, 2023

Bitcoin Oracle: An “Indexer of Indexers” For BRC20 Bitcoin DeFi

ALEX will soon deliver the first Bitcoin Oracle for BRC20 tokens. We haven’t done it alone: this has been a team effort together with @domodata (creator of BRC20 and ALEX advisor), and key existing off-chain indexers, including BestinSlot, OKX, Hiro system, Unisat, and others.

We aim to validate each BRC20 event and update the global state of balances on a decentralized, on-chain contract. The greater the immutability and censorship resistance of a global BRC20 ledger, the faster and broader BRC20 adoption will occur.

The Revolution Continues

Ordinals marked a paradigm shift in the history of crypto. Bitcoin became more than “sound money;” it was transformed into the ultimate data layer. For the first time, satoshis weren’t sold just for their monetary value, but for the information inscribed onto them.

Bitcoin blockspace is the most secure, indestructible, and valuable blockspace in crypto. In addition to Ordinals creating on-chain NFTs that are true “digital artifacts,” inscription data has enabled new use cases we are actively helping develop.

The most successful has been the BRC20 standard, created as an experiment by @domodata to test if fungible tokens could be created on a fundamentally non-fungible blockchain (as every satoshi is numbered). Although Bitcoin’s blockchain doesn’t enforce the token standard rules and token operations are relatively slow and inefficient, BRC20 has been massively popular, accounting for 24M out of 29M ordinals inscriptions to date.


What is Indexing and Why do Indexers Matter?

Although BRC20 inscriptions exist 100% on-chain, the Bitcoin L1 does not “read” the inscription data. There is no error message that pops up to prevent you from inscribing a transfer for more tokens than you hold. All the Bitcoin L1 “sees” are satoshi’s being sent and received, no different from any other Bitcoin transaction.

This is why indexers are critical to BRC20 infrastructure. If there isn’t on-chain code running that will create an “error: $ORDI already exists” then it is up to the indexer of a BRC20 marketplace to determine if $ORDI is authentic or a fake. Without indexing a BRC20 market isn’t possible, there’s just the chaos of nearly indistinguishable text files.

To enforce the token standard rules a number of off-chain indexers have been developed and are in use to address the constraints of the L1. This requires a database that “reads” and registers all of the BRC20 transaction data to check which inscription was the first to “deploy” a new token name.

The indexer must keep track of which wallets minted the original token supply up to the maximum limit, where the cut-off for minting occurred, and are the tokens being “transferred” in the secondary market traceable to these wallets. Although anyone can do the indexing themselves to verify the global state, it is vastly easier to simply consult a centralized indexer.

It is important to make clear that Bitcoin remains the ultimate source of truth. All indexers could go down and there would be no loss of funds as all data is on-chain and could be reconstructed deterministically by applying the rules of the BRC20 standard. Indexing should not be confused with mining; indexing just tracks transactions and does not involve validation or “appending” transaction data.

The Need for On-Chain Indexing

The current BRC20 marketplace reliance on centralized off-chain indexers creates vulnerabilities that consensus and L2 verification can minimize. With individual indexers, errors can occur unintentionally due to performance or intentionally whether due to censorship or even malice. Our efforts are to reduce the “centralization risk” of off-chain indexer error or manipulation which may place user holdings at risk.

Here’s how, using an example: imagine a transaction exchanging 1 BTC for 1000 ORDI. If the BRC20 indexer is wrong and determines the satoshi you are including contains the UTXO for a valid transfer of 1000 ORDI, when actually it’s a valid transfer, the transaction will go through (Bitcoin for Bitcoin) and incorrect indexer data has resulted in the loss of user funds.

This is the reason that we, along with our partners and collaborations, consider the establishment of an on-chain, tamper-proof, and censorship-resistant oracle to be pivotal for greater BRC20 adoption. The aim of the current version of the Bitcoin Oracle is to minimize reliance on any one single entity. The more we minimize trust, the closer the immutability of the BRC20 tokens comes to Bitcoin itself.

 

Bitcoin Oracle: Verifying L1 events with L2 Programmability

We’re collaborating with pioneers like Domo, as well as key existing off-chain indexers, such as BestinSlot, OKX, Hiro system, Unisat and others, to construct an “indexer of indexers.” This concept capitalizes on Stack layer’s unique attributes — programmability and reading the Bitcoin state — to lead the way toward decentralized consensus on BRC20 indexing.

The setup involves off-chain indexers submitting and validating events to the Bitcoin Oracle, which then verifies each transaction through Stacks, either accepting or rejecting them. Wallets and decentralized applications can query this Bitcoin Oracle for valid events, marking an exciting step in our mission to transform the face of Bitcoin DeFi.

The Oracle does not implement an on-chain version of an “indexing engine” which, while theoretically possible, is computationally very expensive, but rather runs a federated model that relies on a consortium of off-chain indexers to validate and submit the latest BRC20 transactions to the on-chain smart contract written by ALEX, which keeps the validators in check by:

  1. Implementing a consensus mechanism
  2. Independently verifying that the purported Bitcoin transaction is indeed mined (which only a Bitcoin L2, such as Stacks, can read directly)

The consensus is reached when a minimum threshold (i.e. “m-of-n”) of indexers agree to a particular BRC20 event. The incentives for indexers to act honestly are monetary and reputational, much as they are now.


A Collaborative Proposal

ALEX’s proposal for the Bitcoin Oracle outlines a comprehensive framework for the integration of off-chain indexers with the Bitcoin Oracle. While the proposal touches upon several pivotal areas, three core elements stand out:

Standardization Prerequisites: Establishing uniform guidelines is paramount. By ensuring all indexers adhere to a common set of rules, the system aims to create a harmonious and efficient environment.

Validator Participation Requirements: As Bitcoin Oracle seeks to uphold the highest standards of data integrity, a clear set of criteria has been defined for projects wishing to serve as validators.

Quality Assurance: To ensure the reliability of the on-chain indexing, rigorous performance monitoring mechanisms will be instituted.

While we work on the framework for a formal governance vote on a proposal like this, ALEX encourages the community to review, discuss, and offer constructive feedback. Such a collaborative approach will not only refine the proposal but also ensure it aligns with the broader community’s needs and aspirations.

Laying the Groundwork

The founding members, which include esteemed names like Domo, ALEX, BIS, Hiro, OKX, and UniSat, are committed to setting a robust foundation. Two significant steps in this direction are:

  • Releasing standard, open-sourced indexing rules that will guide the indexing process.
  • Providing a standard, open-sourced reference implementation of these rules, ensuring that all participants have a clear understanding of the system’s workings.

Joining the Indexing Revolution: Validator Requirements

Becoming a validator for the Bitcoin Oracle is open to everyone, provided projects meet the following requirements:

  • The indexer’s implementation must be open-sourced, promoting a culture of transparency and collaboration.
  • Projects must have a proven track record, with an operating history of at least three months, ensuring reliability.
  • The indexer’s implementation should be peer-reviewed and gain approval from at least two existing validators, maintaining the ecosystem’s quality.
  • Validators are expected to integrate seamlessly with the Bitcoin Oracle, adhering to the guidelines available here.

Upholding Excellence: Performance Monitoring

To ensure the Bitcoin Oracle’s continuous high performance, a dedicated dashboard will be instituted. This real-time monitoring tool will provide insights into each validator’s performance metrics, such as freshness, accuracy, latency, and availability. Validators falling short of the expected standards will be granted a grace period to improve. Persistent underperformance might result in removal, ensuring the Bitcoin Oracle remains efficient and reliable.

Conclusion

The DeFi landscape continues teeming with possibilities, and at the heart of it all, Bitcoin DeFi is set to take center stage. Ordinals have opened up new possibilities that at the start of 2023 were mere wishful thinking: we’ve witnessed NFTs and non-fungible tokens “come home” to Bitcoin enthusiastic community support.

Now we’re entering a new phase of the growing application of L2 solutions to overcome L1 scalability and programmability limitations. ALEX has already launched the B20 Orderbook and L1 Launchpad, functionalities that combine the best L1 / L2 features for optimal user experience. With the Bitcoin Oracle, it will be evident to an ever greater audience, how profound the advantages are of utilizing Bitcoin layers to remove the need for “trust” not only from BRC20 but countless new Bitcoin utilities on the horizon.