Meet Ordhook, a reorg-aware client indexer for ordinals, built using Chainhook—our previously launched indexer for Stacks and Bitcoin. With Ordhook, indexing takes hours instead of days, and developers get consistent, reliable, near-real-time inscription data, including cursed inscriptions not recognized by the canonical <code-rich-text>ord<code-rich-text> client.
Ordhook is also fork-aware. Bitcoin developers know that sometimes more than one valid chain tip is mined simultaneously, any one of which could become the chain with the longest proof of work. A client that switches its view of the blockchain to this new, longest chain experiences what is called a “reorg”.
In the event of a reorg, which happens often with Bitcoin, Ordhook automatically rolls back any invalid blockchain data, which means your apps get reliable data no matter what.
With ordhook, apps get reliable inscription data no matter what.
With this new tool from Hiro, Bitcoin developers can focus on building amazing, feature-rich applications—from wallets to exchanges to marketplaces and more—without having to worry about maintaining an ordinals client. Let’s dive into the details.
Background on Ordinals
Ordinal Theory attributes unique identifiers to minted satoshis (sats). It’s a clever numbering scheme, first proposed by Casey Rodamor, to inscribe arbitrary content (inscriptions) to individual satoshis, creating Bitcoin-native digital artifacts.
Ordinals are popular in part because they do not require a sidechain or separate token. They are built directly on Bitcoin and today account for as much as 85% of activity on Bitcoin.
Since ordinals is such a nascent protocol, the standards for inscription types are still evolving. For example, BRC-20 inscriptions are a recent innovation on top of ordinals that enable developers to create fungible tokens on Bitcoin, and today BRC-20 inscriptions account for over 90% of ordinals-related activity on Bitcoin. The ordinals landscape is evolving rapidly.
This makes ordinals an exciting area for building, but it also makes it challenging for developers looking for reliable data in their applications. Unfortunately, there isn’t a simple way to call or index the latest and most accurate inscription data without indexing the entire Bitcoin chain. That can take weeks, and that timeline is getting longer every day. Plus, reorgs can crash your database, forcing you to reindex the entire chain all over again. That’s simply not good enough.
The ordinals landscape is evolving rapidly. Devs need a stable, accurate indexer to keep up.
Ordinals applications such as wallets, exchanges and marketplaces, need accurate inscription data in order to identify which sats contain inscriptions, so that you don’t accidentally spend your favorite inscription on a cup of coffee and so that they can accurately display ordinals data for their users.
Ordhook offers a nimble solution that indexes ordinals data quickly and reliably, so that you can focus on building your application instead of dealing with headaches around indexing the data in the first place.
When To Use Ordhook vs the Ordinals API
Ordhook now powers all of Hiro’s ordinals tools - from the Ordinals Explorer to our Ordinals API. Ordhook is completely open-source, meaning anyone can use it to build their own APIs, indexes and ordinals infrastructure. More clients are good for the overall health and stability of the ordinals ecosystem! We encourage you to start building with ordhook.
Ordhook now powers all of Hiro’s ordinals tools, including the Ordinals Explorer and the Ordinals API.
So when would a developer use an indexer like Ordhook, the Ordinals API or a hosted development environment? Let’s unpack those use cases.
Using an Indexer
<code-rich-text>Ordhook<code-rich-text> is a package that allows you to download and work with blockchain data on your own. This could be for application development, testing, ideation and iteration.
The emphasis here is getting custom or finely tailored slices of blockchain data to work with (such as a unique subset of inscriptions). An indexer is also helpful if you want to be fully sovereign and not rely on any 3rd party for some hosted service.
However, using an indexer yourself also has challenges: it won’t be easy to deliver data to a lot of users through a web app or to maintain constant uptime under high traffic scenarios.
Using an API
The Ordinals API delivers reliable data payloads to web applications and can handle high volumes of traffic. Leveraging an API is great for devs who value performance and low latency. In turn, you hand off data maintenance and indexing to a 3rd party, such as Hiro, to deliver that at scale for you.
Start Building With Ordhook
All of our ordinals tooling is open-source. We encourage you to take a look at the code, build on it, and contribute. Ordinals are an exciting innovation on Bitcoin, and we can’t wait to see what you build now that you have a reliable index at your fingertips.
Want to learn more about Ordhook? We are hosting a webinar this Friday, September 8th at 11:30am ET to walk through the basics of building with ordinals. During the webinar, we’ll show you how to build an ordinals explorer in 30 minutes. RSVP here.