Introducing Asteroid Protocol: An open source framework for inscriptions and tokens on Cosmos Hub and beyond

Delphi Labs
17 min readJan 16, 2024

Update on Jan. 24, 2024: Please note that the specification for Asteroid Protocol is a living document. The article now contains some outdated specifications. Please refer to the Asteroid Github for the latest documentation.

Summary

  • With Asteroids, anyone can permanently publish content directly onto the Cosmos Hub blockchain where it will live on in perpetuity
  • Developed in collaboration between Delphi Labs and the Astroport Foundation, the framework brings inscriptions and fungible tokens to the world’s largest Cosmos blockchain by market cap — a chain that doesn’t natively support tokens or smart contracts by design
  • The open source framework includes an Asteroid indexer, explorer, API, Cosmos Fungible Token (CFT-20) specification, a token deployer and minting tool, and front-end/back-end software
  • Anyone can connect their Keplr wallet and begin inscribing data, images and text and/or minting CFT-20 tokens — including the world’s first CFT-20, ROIDS — now at asteroidprotocol.io
  • As a metaprotocol framework, Asteroids are substantially more powerful than alternative approaches, which have largely relied on Cosmos SDK’s “memo” field and do not support metaprotocol-like functionality or larger files up to ~550kb
  • All software and specifications are experimental, unaudited and not “endorsed” by any entity including Delphi Labs and the Astroport Foundation. Use at your own risk

Introduction

Launched by Casey Rodarmor in January of 2023, bitcoin ordinals allowed anyone to publish data directly into the 500+ gb file that makes up the bitcoin blockchain. Controversial and irreverent, artists, techies and devs raced to push JPGs onto the blockchain.

Every piece of content uploaded to the blockchain received an “inscription number.” That means the first ordinal — a skull inscribed by Rodarmor himself — was Inscription #0. The second piece of artwork was Inscription #1 and so on.

By Feb. 1, 2023, there were 679 inscriptions in existence. Just one month later, there were 243,419 (up 35,000%+).

Around that time, Delphi Labs contributor Redphone, published a tweet proposing a way to inscribe fungible tokens onto Bitcoin using .json files. He dubbed the idea BRC-20s.

A few days later, another anon, Domo, formalized the concept into a specification and deployed the first token, ORDI, directly on top of bitcoin.

Sheer madness ensued, and BRC-20s became the leading use-case on ordinals.

Today, there are more than 60,000 tokens on top of bitcoin with a combined market cap in the billions of dollars. ORDI alone has a market capitalization of $1.5 billion and trades on more than 20 centralized exchanges including Binance and OKX.

Every time a token is deployed, minted or transferred on-chain, a new inscription
is created. The arrival of BRC-20s on bitcoin in mid-March helped send inscriptions parabolic.

All told, there are now more than 55 million bitcoin inscriptions in the world, and the concept has set off a flurry of development, not just on bitcoin but throughout the entire crypto ecosystem. Inscriptions are also rapidly propagating across every major L1 blockchain (Solana, Dogecoin, Litecoin and more), and we’re even witnessing inscription-like experiments on non-blockchain-based publishing platforms including X (formerly Twitter).

While much of the activity is speculative in nature, we believe there’s profound technological innovation here. Unlike NFTs, which often point to off-chain data stored on Filecoin, IPFS, Arweave or even centralized databases, inscriptions live entirely on-chain. In that way, inscriptions treat blockchains as permissionless, immutable databases.

In other words, inscriptions give anyone the ability to permanently write data to a blockchain and be assured that that data will live on that blockchain for as long as it exists.

As we’ve thought about and explored the inscriptions model over recent months, we’ve come to view it as a bridge between the worlds of web2 and web3.

Before inscriptions, developers had to have familiarity with smart contracting languages and web3 dev tooling. With the rise of inscriptions, even web2 devs can leverage blockchain data to build web3 applications without writing a single line of smart contract code. They can simply read in data that’s written directly on-chain.

It represents a seachange for crypto, and a massive opportunity to enhance functionality on Cosmos Hub and drive new fee income for validators. The world’s largest Cosmos blockchain by market cap, the Hub currently lacks support for native tokens and smart contracts by design.

Asteroids introduce that functionality in a way that’s scalable and accessible to anyone — including end users and web2 devs.

Let’s look at how it works.

The dawn of Asteroids

Hurtling through the galaxy at speeds of 250,000 kph+, asteroids leave indelible marks on the planets unfortunate enough to stand in their paths. They resculpt the very surface and leave traces of their impact for as long as a planet exists.

Cosmos Asteroids have a similar effect. With them, anyone can permanently write data to Cosmos Hub (and potentially other Cosmos SDK blockchains), and that data will live on for as long as the blockchain exists.

The Asteroid Protocol is a generalized metaprotocol framework. That means anyone can use it to create their own Asteroid protocol. To date, we’ve already defined two key types of Asteroid metaprotocols:

  1. Arbitrary content inscriptions: With arbitrary content inscriptions, users can publish virtually any sort of data that a browser can display… from JPGs to videos, text to JSON, HTML and even online games… directly on the Hub. File sizes can be as large as ~550kb.
  2. Cosmos Fungible Tokens (CFT-20): A way of deploying, minting and transferring fungible tokens on Cosmos Hub, which does not natively support fungible tokens by design.

The Asteroid framework is fully extensible as well, meaning anyone can define and launch their own metaprotocol on Cosmos Hub.

In the sections below, we’ll first look at the genesis of the idea behind Asteroids. Then, we’ll dive into how Asteroid metaprotocols, CFT-20s and arbitrary content inscriptions are intended to work.

Don’t want the nitty-gritty details? Jump directly to the tutorials for inscribing artwork and tokens now.

Asteroid’s genesis and creators

The Asteroid Protocol is a close collaboration between Delphi Labs and the Astroport Foundation. Championed by Delphi Labs contributor, Red Phone, who also put forth the initial idea for BRC-20s on bitcoin, and Astroport Foundation contributor Donovan Solms, the lead dev on Asteroids, we identified Cosmos Hub as quite possibly the second-best blockchain in crypto for inscriptions — behind only bitcoin.

Asteroid Protocol isn’t merely a clone of inscriptions on other chains. It’s several metric tons of rock slamming into Cosmos Hub and forever altering its trajectory.

Today, Cosmos Hub is the world’s largest Cosmos blockchain by market cap. And yet, it has no native support for smart contracts, NFTs or fungible tokens by design. In effect, it’s a powerful global computer capable of processing thousands of transactions per second that’s largely sitting on standby — hungry to do more; to be more.

Asteroids should awaken the Hub’s latent power.

In fact, we believe Cosmos Hub has the potential to become THE database of record for any project in the Cosmos and beyond. By permanently writing data there, it could pivot to compete not merely with other Cosmos chains, but with Filecoin, IPFS and Arweave — and it should reward validators richly in the process.

Since inscription data can be consumed by even web2 applications, it could also turn Cosmos Hub into an affordable, easy-to-integrate bridge between the worlds of web2 and web3.

Starting now, old world devs have the ability to build atop the Hub without writing a single line of smart contract code.

To summarize: if Asteroids become widely used, they could:

  • Usher in new functionality on Cosmos Hub without impacting the chain’s core value proposition
  • Dramatically expand the scope of what’s possible on Cosmos Hub, bringing it more transactions, users and visibility
  • Generate a new income stream for Cosmos Hub validators and ATOM stakers
  • Reinvigorate and align the Cosmos Hub community
  • Enlarge the Cosmos Hub development community by making it easier to integrate the blockchain’s data into web2 applications

Asteroid — The Cosmos Metaprotocol Framework

Asteroids provide a framework for building inscriptions-based protocols on top of a Cosmos SDK blockchain. These protocols inscribe their content in a structured format to be indexed and used off-chain. This is particularly useful on the Cosmos Hub as the Hub does not have smart contract capabilities.

The current implementation uses a URN (Uniform Resource Name) in the transaction memo field with any other content required for the metaprotocol inscribed in the non_critical_extension_options (NCXO) field in Cosmos SDK blockchains (more on this later).

The following code illustrates an example of a simple Asteroid metaprotocol transaction:

The memo field holds the URN for the metaprotocol and allows the identification of the protocol as well as the operation being applied. Metaprotocols may or may not use and rely on other fields in the transaction. The Asteroid framework places no restriction on a metaprotocol other than:

  1. a cosmos.bank.v1beta1.MsgSend message must be part of the transaction and
  2. a valid URN (see RFC-2141) must be specified in the memo field

The URN structure is typically:

urn:{metaprotocol}:{chain-id}@{version};{op}${param1}={value1},{param2}={value2},{paramN}={valueN}

We examine specific examples of the URN structure in the section on CFT-20 tokens below. However, the URN structure is flexible enough to support virtually any sort of protocol a developer can imagine.

Because our method allows up to ~550kb (and theoretically as much as 800kb) of arbitrary data to be inscribed on the Cosmos Hub, and we place no limitations on what that data may be, anyone can use it to build a very wide variety of on-chain protocols. Some ideas could include a social network, blogging platform, forums, encrypted chat and more.

Asteroid metaprotocol fees

Inscribing data on Cosmos Hub requires an on-chain transaction. When using Asteroid Protocol, that transaction simply transfers a tiny amount of ATOM (0.000001 ATOM) from the inscribing address back to the same address. Effectively, users send funds to themselves with every inscription.

While there is no “Asteroid Protocol” fee to mint inscriptions, users do have to pay a small gas fee to complete the transfer. We’ve increased the minimum level of gas that might be required for this transfer by around ~40%. This increase helps prevent transaction failures and goes directly to the Hub’s validators and ATOM stakers, which should ensure their ongoing support for Asteroid Protocol. However, if the Hub and staking community believes this fee should be eliminated, Asteroid Protocol is open source and could be forked to introduce an alternative protocol, which sets fees at the absolute minimum level possible.

Now, let’s look at the first two Asteroid metaprotocols that we’ve defined:

  1. The Cosmos Inscriptions Specification
  2. Cosmos Fungible Token (CFT-20) Standard

1. The Cosmos Inscriptions Specification

The Cosmos Inscriptions Specification details a way to inscribe arbitrary data onto a Cosmos SDK blockchain. Inscribing data onto the chain ensures it will live on for as long as the chain is running.

The design takes inspiration from the rather clever ordinals implementation on bitcoin, which uses data pushes within unexecuted taproot conditionals, called “envelopes.” This “backdoor” approach enables users to write data directly to the bitcoin blockchain.

The Cosmos SDK differs in a big way from other blockchain implementations in that messages are validated, and rarely do you find any part of a transaction that isn’t strictly controlled by some definition. This is generally good and avoids a lot of mistakes, however, it also makes it harder to put arbitrary data in a transaction.

One of the fields that are somewhat suited for inscriptions is the “memo” field. The memo field is used in transfers to centralized exchanges as well with IBC-Hooks. The memo field is very limited though, with a maximum length of 512 characters on Cosmos Hub. There was an attempt on the Cosmos Hub forum to increase the size of the field, but it doesn’t seem a proposal was put to a vote on this.

There is another section of a transaction that allows arbitrary data to be added as long as you conform to the message type built into the chain. This section is non_critical_extension_options (NCXO).

From the SDK documentation:

extension_options are arbitrary options that can be added by chains when the default options are not sufficient. If any of these are present and can’t be handled, they will be ignored

The final part of the description is key: “If any of these are present and can’t be handled, they will be ignored.” This leaves a path for adding content that is not validated past the protocol buffer type. As long as you use a type known to the chain, it can be used. An example is the sending of tokens below using the /cosmos.bank.v1beta1.MsgSend type:

In this example, the field names are validated, but the content of the fields are not. This is expected as this specific option isn’t handled and thus ignored. Indeed, none of the tests we attempted generated errors. One of the caveats of this approach, however, is that SIGN_MODE_DIRECT is required, which means this will not work with Ledger devices.

MsgSend is not really well suited for what we want to achieve, and we feel that /cosmos.authz.v1beta1.MsgRevoke is better suited. It has the following structure:

With a bit of creativity, that means we can:

  1. Identity the type of content stored in this transaction
  2. Provide metadata for the content stored
  3. Store arbitrary data in base64

That gives us:

With each field is defined as follows:

We use the MsgRevoke here as no-op, and it is ignored by the chain when part of non_critical_extension_options. In any case, the content is invalid and the chain would reject the message if it was ever implemented as part of non_critical_extension_options since Asteroids rely on the content not being validated.

Note that Asteroids rely on public RPC nodes for submitting transactions and indexing inscriptions and tokens. If those nodes go offline, transactions could fail and/or be delayed. In the event of a delay, Asteroid indexers could temporarily report stale/inaccurate information. Use caution when interacting with Asteroids during periods of network congestion and/or offline RPC nodes.

1.1 How to create your first Asteroid inscription using the Cosmos Inscriptions Specification on Asteroid Protocol

Prerequisites:

  • Keplr wallet
  • A nominal amount of $ATOM on Cosmos Hub (ATOM is available on leading exchanges including Binance and Coinbase) as well as decentralized exchanges including Astroport
  • The file you’d like to inscribe in any format supported by browsers (i.e. .txt, .html, .jpg, .png)

Steps:

  1. Visit asteroidprotocol.io and connect your Keplr wallet
  2. Click “Create” under “Inscriptions” in the navigation pane
  3. Click “Select file” to choose the file you’d like to inscribe (up to a maximum of ~550kb)
  4. Enter a name and description for your inscription
  5. Click the “Inscribe” button and approve the transaction in your wallet
  6. That’s it! Your inscription should soon appear on asteroidprotocol.io. Simply navigate to Wallet → Inscriptions to see it

2. Cosmos Fungible Token (CFT-20) Standard

The CFT-20 token standard describes how to create, mint and transfer fungible tokens using the Asteroid metaprotocol framework. It is derived from the initial BRC-20 idea from Red Phone (one of the authors of this paper) and implementation from Domo. However, it differs in implementation, and takes an approach inspired by Casey Rodarmor’s RUNES protocol, which is under development, as well as the nascent CBRC-20 protocol.

The CFT-20 standard is implemented using the Asteroid metaprocotol framework. It relies only on the URN in the memo field with the exception of an optional logo that may be specified when creating a token that uses Asteroid inscriptions.

To create a CFT-20 token, use the following URN:

urn:cft20:{chain-id}@{version};{operation}${param}={value},{param}={value}

The operation values are:

The required parameters are:

To mint a token, anyone can use the following URN:

urn:cft20:{chain-id}@{version};{operation}${param}={value},{param}={value}

The operation values are:

The required parameters are:

To transfer a token, anyone can use the following URN:

urn:cft20:{chain-id}@{version};{operation}${param}={value},{param}={value}

The operation values are:

The required parameters are:

Beyond OTC-based swaps, trading tokens is not currently possible. However, we’re actively exploring possibilities to enable it (see the Marketplace Fees section below for more).

2.1 Introducing the world’s first CFT-20 token: Asteroids (ROIDS)

Moments before the publication of this article, we deployed the first experimental CFT-20 on mainnet. Dubbed Asteroids (ROIDS) it has a maximum supply of 100 million tokens, and anyone can mint up to 1,000 tokens in a single transaction.

Note that ROIDS is an entirely experimental token with no value and no roadmap. Do not treat ROIDS as an investment. Instead, it’s a proof of concept, and anyone can help us test Asteroid Protocol by minting it now. The sections below detail the process.

Prerequisites:

  • Keplr wallet
  • A nominal amount of $ATOM on Cosmos Hub (ATOM is available on leading exchanges including Binance and Coinbase as well as decentralized exchanges including Astroport)

Steps:

  1. Visit asteroidprotocol.io and connect your Keplr wallet
  2. Click “Browse” under “CFT-20 Tokens” or navigate directly here
  3. Select the ROIDS token, and submit your mint transaction

2.2 How to deploy a new CFT-20 token

Prerequisites:

  • Keplr wallet
  • A nominal amount of $ATOM on Cosmos Hub (ATOM is available on leading exchanges including Binance and Coinbase as well as decentralized exchanges including Astroport)
  • A square token graphic of at least 250x250 pixels, a token name, ticker, supply and mint limits

Steps:

  1. Visit asteroidprotocol.io and connect your Keplr wallet
  2. Click “Create” under “CFT-20 Tokens”
  3. Click “Select file” to add your token icon (up to a maximum of ~550kb)
  4. Enter a name, ticker, supply and mint limit for your inscription
  5. Choose whether you’d like to launch your token immediately or at a future date and time, which you can specify
  6. Click the “Create token” button and approve the transaction in your wallet
  7. That’s it! Your token should soon appear on asteroidprotocol.io. Simply navigate to CFT-20 Tokens → Browse to find it and the token’s associated minting page

2.1 How to mint a pre-existing CFT-20 token

Prerequisites:

  • A Keplr wallet with preexisting CFT-20 tokens in it
  • A nominal amount of $ATOM on Cosmos Hub (ATOM is available on leading exchanges including Binance and Coinbase as well as decentralized exchanges including Astroport)

Steps:

  1. Visit asteroidprotocol.io and connect your Keplr wallet
  2. Click “Browse” under “CFT-20 Tokens”
  3. Click on your desired token (note that the mint percentage must be <100%. Once a token hits 100%, it is minted out and unavailable for additional minting)
  4. Click the “Mint Now” button, and you’ll be prompted to approve your mint transaction. This will mint the maximum amount of tokens that can be minted in a single transaction.
  5. That’s it! Your token should soon arrive in your wallet where it can viewed by connecting at asteroidprotocol.io.

2.3 How to transfer a CFT-20 token

Prerequisites:

  • A Keplr wallet with preexisting CFT-20 tokens in it
  • A nominal amount of $ATOM on Cosmos Hub (ATOM is available on leading exchanges including Binance and Coinbase as well as decentralized exchanges including Astroport)

Steps:

  1. Visit asteroidprotocol.io and connect your Keplr wallet
  2. Click “Wallet”
  3. Click on the token you’d like to transfer on the Tokens tab
  4. Click “send” and input an amount and receiving address
  5. Click the “send now” button
  6. That’s it! Your token should soon arrive in a new address where it can viewed by connecting at asteroidprotocol.io. Ideally, Keplr and other Cosmos Hub wallets will one day support CFT-20 tokens, so users will be able to view and transfer them directly from their wallets

2.4 How to buy or sell existing inscriptions and CFT-20 tokens

Prerequisites:

  • A Keplr wallet
  • A nominal amount of $ATOM on Cosmos Hub (ATOM is available on leading exchanges including Binance and Coinbase as well as decentralized exchanges including Astroport)

Steps:

  1. Visit asteroidprotocol.io and connect your Keplr wallet
  2. Click “CFT-20 Tokens” → “Markets”
  3. Search for the token you’d like to sell and click the “Sell” button
  4. Search for the token you’d like to buy and click on it to see all the available listings and a “Buy” button

Marketplace fees

For inscriptions to reach their full potential, they must be fast, cheap and easy to swap. They also need to be eligible for smart contract interactions. That’s why we’re so excited to collaborate on Asteroids with devs from the Astroport Foundation.

If inscriptions (and inscribed tokens in particular) are to become a mainstay in crypto, Astroport must be at the vanguard of that change to remain relevant. That’s why we’ve built out an off-chain, orderbook-style marketplace for swapping inscribed tokens from Day 1.

Online at asteroidprotocol.io, listing and delisting fees are set at 0%. All marketplace trades feature a 2% swap fee, which is IBC’d to Terra and deposited in Astroport’s $xASTRO staking pool with each transaction. This is NOT a fee for Asteroid Protocol, but merely a fee for using the marketplace at asteroidprotocol.io. Since Asteroids are open source, anyone is welcome to create their own OTC marketplace for Asteroids where they can set their own fees.

The marketplace fee at asteroidprotocol.io is intended to ensure that Astroport contributors remain incentivized to further develop the Asteroid Protocol and should preclude the need to request funding from the Hub at a later date.

If we’re correct, and inscription-based tokens prove to be more than a passing fad, inscription-based swapping will likely become common on DeFi DEXes. By dedicating a portion of marketplace fees to Astroport, we can incentivize protocol contributors to stay on the leading edge of inscription development.

To that end, we’ve also sketched out plans to build a custom bridge that would enable inscribed tokens to flow freely from the Hub to an IBC-enabled smart contract chain and back again. All bridged tokens would be minted as token factory tokens, which could then be deployed in Astroport liquidity pools. Note, however, that this functionality is currently hypothetical, and there is no guarantee that it will be enabled.

Asteroid Toolkit

An Asteroid explorer and minting tool is live at asteroidprotocol.io. There users can find documentation on the framework, deploy and mint CFT-20 tokens, view new inscriptions and find links to Asteroid’s APIs and open-source code.

The framework’s release also includes the following:

  • Specifications for the Asteroid metaprotocol framework, arbitrary inscriptions and CFT-20 tokens
  • An open-source indexer
  • An open-source API
  • A minting tool and explorer live at asteroidprotocol.io
  • An open-source front-end and backend for deploying your own Asteroid explorer

All these tools can be found in the Asteroid Github repository, and we encourage you to begin building on top of Asteroids now.

Conclusion

The Astroport Foundation is committed to making LP’ing great again with:

  • XYK, stableswap and passive concentrated liquidity (PCL) pools
  • A hub and spoke design that allows swapping outposts on virtually any Cosmos chain
  • An upcoming tributes protocol that gives protocols and tokenholders a way to direct rewards to their favorite liquidity pools.

Delphi Labs has a simple mission: to make crypto adoption happen faster than it would without us.

Together, Labs and Astroport have watched with fascination as inscriptions rapidly proliferate across multiple blockchains. That’s led to a flurry of innovation, and we believe it’s time to bring inscriptions to the Hub in a scalable and extensible way.

The permissionless, immutable nature of blockchains gives the world a fundamentally new sort of database: one that even web2 developers can utilize and integrate into traditional web applications.

We also believe that Cosmos Hub, which does not natively support smart contracts or the issuance of fungible tokens, is particularly well-suited for the deployment of an extensive inscriptions-based metaprotocol framework.

However, we’ve designed the framework to be as flexible and wide-ranging as possible. Therefore, it should be extensible to virtually any Cosmos SDK blockchain. This work leverages more than a year of development on bitcoin, and brings the most up-to-date ordinals functionality to the Cosmos for the first time.

We hope that the community finds it useful and we look forward to any community feedback and/or deployments. Let’s cook in the Asteroid Protocol Telegram group!

Then, let Asteroids fill the sky on Cosmos Hub and beyond at asteroidprotocol.io.

Authors: @donovansolms, @redphonecrypto

Please remember Asteroid Protocol is open source, unaudited, and radically experimental ☄️ Use it at your own risk and remember CFT-20s are experiments, too, NOT investments!

Key links

--

--

Delphi Labs

The next evolution of incubation leveraging our hivemind of expertise at @delphi_digital