Original Title: "Recursive Inscription: The Foundation of BTC Lego Combinations and Complex Logic Products"
Original Author: @JellyZhouishere, @GryphsisAcademy
TL;DR
As the latest major update to the Ordinals protocol, Recursive Inscriptions have opened up vast possibilities for the composability of the Ordinals protocol.
Recursive inscription is a standard for inscription parsing. Creating a PFP collection inscription can be achieved by uploading corresponding element features, which can be combined and spliced without uploading or downloading actual images. Recursive inscription has the characteristics of enhancing interoperability, reducing costs, and allowing the size of inscriptions to exceed the 4MB limit.
The creative directions based on recursive inscriptions include: inscription disassembly and combination, Bitcoin music, Bitcoin chain games, generative art, decentralized websites, etc. This article provides a detailed introduction to some typical cases that combine recursive inscriptions, which demonstrate the powerful potential of recursive inscriptions.
Recursive inscriptions also face some challenges: whether the relevant parsers for chain rendering can quickly parse when the recursion level increases; whether the relevant parsers for chain rendering can quickly parse when the number of referenced inscriptions increases, and so on. In theory, the games or NFTs generated by recursive inscriptions can be infinitely complex and refined. However, due to the limitations of the BTC network itself, indirect technical solutions are needed for implementation.
Recursive inscriptions allow inscriptions to interact with each other, enabling new use cases. Generating art, displaying on the chain, and efficient storage have now become a reality. We can look forward to the development of recursive inscriptions in the fields of generating art, chain games, and metaverse, and believe that killer applications of the future are brewing.
The birth of the Ordinals protocol provides Bitcoin with the functionality of numbering and inscription, thus expanding the product range of the Bitcoin ecosystem and bringing tremendous potential for application to the Bitcoin ecosystem.
In the past few months, we have seen the Ordinals track gradually grow from obscurity to an ecosystem, during which the Ordinals protocol has also undergone important upgrades and produced a series of derivative protocols:
In our June Ordinals series articles, we also updated the detailed introduction of various derivative protocols of Ordinals and BRC20 (link: https://medium.com/@gryphsisacademy/diving-into-ordinals-how-to-bet-on-bitcoin-ecosystem-as-halving-approaches-3486db8cbf12). Among them, we have to mention the recent major update of Ordinals - the appearance of recursive inscriptions.
Recursive Inscription was announced on June 12th by Raph, the new Chief Maintainer of the Bitcoin protocol Ordinals, on Github. It further integrates the Recursive Inscription 2167 proposed by Casey Rodarmor, the creator of the Ordinals protocol, into the Ordinals code, opening up vast possibilities for the composability development of the Ordinals protocol.
This article will explore the principles of recursive inscriptions and their impact on Ordinals, and further explore the possible innovative application directions of recursive inscriptions through existing cases.
Since the end of December 2022, Casey Rodarmor has released the Ordinals protocol, which introduces NFTs to the Bitcoin network through ordinals and inscriptions. This protocol allows for the creation of unique digital artifacts by adding any content, such as text, images, videos, or even applications, to sats (the smallest unit in Bitcoin) that are sequentially numbered, and can be transmitted through the Bitcoin network. Below, we will outline the important technical principles involved in the Ordinals protocol.
Bitcoin adopts a payment model called "Unspent Transaction Output" (UTXO), in which all balances are stored in a list of UTXOs. Each UTXO contains a certain amount of Bitcoin, owner information, and indicates whether it is available or not.
In Bitcoin transactions, each transaction has inputs and outputs. Inputs refer to the references of existing UTXOs, while outputs specify new addresses and amounts. After initiating a transaction, the inputs lock the relevant UTXOs to prevent duplicate use until the transaction is confirmed. Once confirmed, the input UTXOs are removed and the outputs generate new UTXOs.
The total input amount of a transaction usually exceeds the total output, and the difference is called the network fee, which rewards the miners who package the transaction. The network fee is proportional to the complexity of the transaction, and transactions with multiple inputs and outputs usually require higher network fees.
There are a total of 2100 million * 10^8 satoshis on the Bitcoin network. How does the Ordinals protocol uniquely identify each satoshi and track its corresponding account?
According to the Ordinals protocol, the numbering of Satoshis is determined by the order in which they are mined. The metadata of Ordinals is not stored in a specific location, but is embedded in the witness data of transactions, which are "carved" like inscriptions on a specific part of Bitcoin transactions, and this data is attached to specific Satoshis.
This process is achieved through Segregated Witness (SegWit) and Pay-to-Taproot (P2TR) isolation witness, which can engrave any form of content (such as text, images, or videos) on the designated Satoshi.
SegWit is an important protocol upgrade for Bitcoin. It separates some transaction signature data (witness data) from the transaction itself, reducing the data size stored in Bitcoin blocks. This measure expands the capacity of blocks, allowing them to accommodate more transactions, improving the network's transaction processing capabilities, and reducing fees.
SegWit protocol upgrade introduced a new witness field in transaction outputs to protect privacy and improve performance. Although the design of witness data was not intended to store data, it actually provides us with an opportunity to store metadata such as inscriptions.
The Taproot protocol upgrade introduced in 2021 allows for different transaction conditions to be stored more privately on the blockchain. Through the Taproot script path, we can store plaintext content in spending scripts, which have almost no limitations in terms of content. Additionally, due to Taproot's discount mechanism, storing plaintext content has become more economical and can save a significant amount of resources.
Ordinals protocol cleverly utilizes SegWit to relax the limit on the size of content written to the Bitcoin network, storing plaintext content in witness data, with a maximum of 4MB of metadata. Taproot makes it easier to store arbitrary witness data in Bitcoin transactions, allowing Ordinals developer Casey Rodarmor to reuse old opcodes (OP_FALSE, OP_IF, OP_PUSH) to describe the encapsulated content as plaintext, thus storing any data.
Commit: The first step is to create an output that points to a Taproot script containing the plaintext content in the commit transaction. This output uses the Taproot storage format. At this point, the plaintext data is associated with the UTXO of the transaction output, but has not yet been disclosed.
Reveal: At this stage, a transaction is initiated by using the UTXO corresponding to the inscription as input. At this point, the corresponding inscription content is disclosed to the entire network.
Through the above two steps, the inscription content has been bound to the UTXO it remembers. Then, according to the previously mentioned satoshi, the inscription is implemented on the first satoshi corresponding to the input UTXO. The inscription content is included in the input that displays the transaction. This specially inscribed satoshi can be transferred, purchased, sold, lost, and recovered.
After understanding the basic principles of Ordinals, let's take a look at recursive inscription: the Ordinals protocol introduces the ability to completely inscribe files on the Bitcoin blockchain. Before the appearance of recursive inscription, ordinals were like isolated and limited islands. Although you can inscribe text, images, and code, they cannot interact with each other.
However, with the introduction of recursive inscriptions, the situation is about to change. Now, inscriptions can use the special "/-/content/:inscription_id" syntax to request the content of other inscriptions. This allows users to create inscriptions on the Bitcoin chain with less space and lower fees.
Recursive inscription is a standard for inscription parsing. Its syntax is essentially similar to using code to find images. PFP collection inscriptions can be created by uploading image corresponding pattern, color, action and other element features, and then combining and splicing the corresponding elements that already exist on the chain, without uploading or downloading actual images.
The recursive rune has the following characteristics:
Through the unique self-referential properties of recursive inscriptions, we have the opportunity to break free from the constraints of previous inscription methods and overcome the awkwardness of each inscription being isolated and unrelated, thus opening up the possibility of creating freely combinable inscriptions.
Recursive inscriptions, in the form of their textual code, maintain a small size, reducing costs and allowing the size of inscriptions to exceed the 4MB limit of Bitcoin blocks.
This advancement enhances interoperability, programmability, and scalability, injecting more possibilities and creative imagination into the Bitcoin chain.
From the perspective of the protocol, the future prospects are very broad, with rich narratives waiting for developers and users to construct and use.
However, there are still some challenges at present, such as whether the inscriptions can be included in the platform's collection and index, which will determine the speed of its development and the degree of widespread recognition.
The emergence of recursive inscriptions has unlocked many powerful innovative applications. Recursive inscriptions have the advantages of high flexibility, callability, splicing and low cost, bringing infinite new possibilities to inscriptions. This article will introduce the potential innovation and application directions of recursive inscriptions through some specific cases.
Through recursion, Inscriptions can easily reference the code of other Inscriptions. The content of an Inscription can now be used by many other Inscriptions. This new composability opens up possibilities in areas we have barely explored, such as engraving complex images, videos, 3D games, and other forms of content on the chain. Recursive Inscriptions make it possible to build an internal internet. More possibilities include secondary creation of Inscriptions, decentralized GitHub, NFT combination and fragmentation, and so on. With recursive Inscriptions, we can achieve the following ideas:
Below we will provide detailed introductions to some typical cases, which demonstrate the powerful potential of recursive inscriptions:
By further combining various basic solutions mentioned earlier, various combinations of collections and secondary creation of inscriptions can be achieved, such as combining a1 and a2 within collection a, and combining collection a with collection b. On this basis, there is hope for the emergence of truly community-driven native interactive generative art on the BTC chain.
Let's first take a look at the first case: 1Mask.
This is a full-chain generated art project on the BTC chain with a mask theme. The 1Mask project cleverly integrates Ordinals' recursive technology, which is composed of three elements: templates, algorithms, and inscriptions.
Source: https://1mask.io/
The template section contains seven types of inscriptions, each corresponding to a unique type of template, and its format follows image/svg+xml.
The basic principle of the algorithm is to use the user's wallet address as a seed and create multiple different color combinations using a random function to color the mask model.
The mechanism for generating inscriptions uses recursive technology to reference algorithmic inscriptions. Each mask inscription is embedded with the HTML code required to build the final colorful mask image. The implementation involves executing the code embedded in the algorithmic inscription using a random seed, while filling the seed with chain data specific to the user (such as a wallet address), making it random but related to the user. Therefore, when the same wallet address is used with the same template, the generated result remains consistent.
Whenever a new mask inscription is created, it incorporates specific on-chain details of the user and references algorithmic inscriptions. With the power of recursive inscription technology, once the newly created mask inscription enters the market or is indexed by a wallet, it autonomously activates the reference code contained within the algorithmic inscription. When these codes run, they use user-specific on-chain data as input and ultimately display a unique and personalized mask image.
In the Bitcoin network environment, the data contained in the inscription has immutability, ensuring its integrity. This feature determines that the real-time image presented based on this unchangeable inscribed data also has immutability. As long as the random seed and algorithm involved in the mask inscription are correct, users can verify the authenticity and accuracy of the creation process at any time.
Behind this project, 1Mask has further launched a standard called BRC721Auto, proposing that fully on-chain generated art should consist of at least two inscriptions: one is the inscription of the code, and the other is the inscription of personalized parameters.
In the code inscription, we need to encode an algorithm that can automatically generate an HTML DOM based on the content of the parameters. The DOM can be a canvas, SVG, or other content that can be recognized by the browser and rendered as graphics.
Of course, code inscriptions can also reference the content of other inscriptions to complete their algorithms.
In the parameter inscription, we need to define an HTML and define a global parameter p to reference a Code Inscription. When ordinary browsers try to display this Parameter Inscription, they will recognize the global parameter p and automatically execute the start() function in the Code Inscription to add or modify the current HTML's DOM, ultimately rendering the content of this HTML. Therefore, parameter inscriptions can be considered as the final NFT (Non-Fungible Token).
With the help of Recursive Inscription technology, the code required to generate graphics, the execution process of the code, and the verification process are all placed under the protection of the Bitcoin blockchain consensus. Unless someone can launch a 51% attack on Bitcoin, no one can control the generation process of ERC721Auto NFT, which will be autonomously executed by the Bitcoin ecosystem.
1Mask has further proposed three major standards for generating on-chain art projects. These three standards are:
Decentralized storage code that automatically generates graphics.
Decentralized personalized graphic generation based on user-provided parameters and code execution.
Decentralized verification of generated results' correctness.
According to the above standards, it is not difficult to find that the on-chain art based on recursive inscriptions has the following characteristics:
Uniqueness and randomness: The work must be generated through algorithms and smart contracts, possessing non-fungible and unique characteristics that can be proven through random chain disclosure. Additionally, it must also have a certain level of artistic and aesthetic value.
Interactivity: Users can interact with and control the work.
Decentralized: Art is completely stored on the chain, completely decentralized, and no centralized institution or individual can control them.
Reuse code, and it is based on Ordinals.
Compared to other on-chain generated art projects such as Ethereum, the BTC recursive inscription-based generated art is a completely on-chain generated art that is independent and decentralized, without relying on any off-chain resources.
Source: https://www.ord.io/?satributes=uncommon&contentType=html&sortBy=newest
(Note: This content contains HTML tags and a hyperlink, which will not be translated. All Chinese characters will be translated.)
If you directly open the collection website of Orbinals, you will find that the content referenced after opening each image in its celestial motion series is the same, with some different parameters. After digging deep into the recursive inscriptions, we can discover the true secret of the project hidden in this reference link (https://ordin-delta.vercel.app/content/b5091b76f78d73677ad6b81e4785b0dfebc62b1079a0bf78b8366859a1ffacbci0). The full name of Orbinals is "Orbinals: Three Body Orbit Artifacts on Ordinals", which is based on the programming of the motion of three objects using HTML and JavaScript, built on the basis of two-body simulation code.
Source: https://evgenii.com/blog/three-body-problem-simulator/
Supported by mathematical and physical equations, the beauty of celestial motion is presented on the Bitcoin chain in a concise manner.
And due to the absence of any social media platforms such as Twitter, Discord, official website, etc., the project is likely to use a very geeky way, and future information will be presented on the sats controlled by the team.
Sorry, I am unable to translate the given content as it does not contain any Chinese characters or words. Please provide me with the Chinese content that needs to be translated.
Aside from the four channels disclosed by the project team, there is also a hidden Easter egg: within the inscriptions referenced by the project (https://ordin-delta.vercel.app/content/4f59fc257a7c78d4074dcd7a4a55360d56986f474700adc7dc37ac231901fc40i0), there is a string of instructions hidden in the code: "future Communication channels on /sats/ acknowledge", and "acknowledge" happens to be a sats belonging to the team.
Source: https://www.ord.io/sat/1940129935364125
(Note: This content contains HTML tags and a hyperlink, which will not be translated. All Chinese characters will be translated.)
BRC69 is a new standard for building recursive sets released by Luminex (https://github.com/luminexord/brc69). The standard uses recursive inscriptions to optimize the cost of using the ordinal protocol to inscribe on Bitcoin, which helps to introduce recursive sets on Bitcoin. In addition, BRC69 provides high flexibility and opens the door for more enhanced features and functionalities, paving the way for more interesting on-chain features such as pre-display functions.
With the help of BRC69, the cost of collecting inscriptions stored in Ordinals can be reduced by more than 90%. This reduction is achieved through a four-step process:
Record Features
Deployment Collection
Compilation Collection
Create assets.
As long as the collection creator publishes the official inscription list of their collection according to the current requirements, all of these processes can be carried out without the need for external indexers. In addition, the images will be automatically rendered on all front-end interfaces that have implemented recursive inscriptions, without any additional steps.
Orditroops is a recursive NFT based on BRC69 protocol, which implements the content of BRC69 protocol and adds the feature of composability. It reduces the space occupied by images and the images are of high definition. The flexible combination of soldiers, weapons, and outfits adds a lot of characteristics and fun to this NFT collection.
The content you provided is:
Source: https://twitter.com/OrdiTroops
Source: https://www.ord.io/3563188a3db53850bba48747293def7bd6b7395e4241b29ec7d49892945cf927i0
(Note: This content contains no translatable text and consists only of HTML tags and a website link.)
OCM is the first 3D NFT project that applies the recursive inscription standard. OnChainMonkey was originally created as an NFT project on Ethereum in September 2021. Earlier this year, the OnChainMonkey series appeared as the first 10k series engraved on Bitcoin.
As a high-resolution 3D animation inscription, OCM quickly stands out for its detail and quality. It's worth noting that before OCM, most inscriptions were still small text files or low-resolution images. Even on 4K or 8K displays, OCM can provide good clarity, which is achieved through files that are no larger than 1 KB each, a level of quality that was difficult to achieve in projects before OCM.
OCM is able to achieve these things because it was the first to use powerful recursive inscriptions. The first 300 inscriptions of OCM were engraved on 300 consecutive satoshis on Bitcoin, starting from block 78 in 2009, and sorted on the chain in ascending order of their satoshi numbers. The OCM builder used compressed code and referenced the P5.JS and Three.JS libraries for future creators to use. Users can view and access the library in their browser, and automatic decompression is performed in the Ordinals protocol when rendering Dimensions Interactive Art.
Through recursive inscriptions, OCM efficiently utilizes block space (each less than 1 KB) and achieves random on-chain disclosure, combining high-definition quality, 3D, animation, and interactive art features.
Source: https://ordinals.com/content/6fd06768414dfc2bd68b55869eea6844864fbf71ee72ec26568520e313c2bda2i0
Enter any word or phrase to generate unique on-chain music. This music engine is a complementary product of the MUD RPG game "Descent Into Darkness", which generates music by entering keywords. Founder Ratoshi emphasized the important role of ChatGPT in developing the project using music, and the use of recursive inscriptions helps significantly reduce costs. A special combination of blockchain technology and artificial intelligence pays tribute to the classic music of retro electronic games.
A game requires various component materials such as images, front-end, and business logic. If the total size of the materials is less than 4M, it can be completed by engraving a Sat without using recursive inscriptions.
There are two situations where recursive inscription technology is suitable:
1. The material itself is large (greater than 4M), for example, a background image of 5M cannot be directly engraved onto a Sat, but it can be split and placed in different Sats for reference and display.
2. If you want to achieve better business logic, for example, if there are 100 Sat inscriptions in a series of games that use the same JavaScript (JS) file, in this case, it is also suitable to use recursive inscriptions, because there is no need to re-engrave the JS file for each Sat inscription.
The HTML (front-end) and JS (business logic) of the game are engraved on the "cong" of BTC, referring to each other, which can generate a single-player H5 mini game.
Here are three examples of single-player H5 games:
a. Snake Game
The content you provided is:
Source: ord.io/431507
Bitcoin Snake Game, this game is a typical H5 single-player game, and it is a well-known game: Snake. The front-end and execution logic of this game are all written on this Sat, and recursive inscription technology is not used. The total number of this NFT series is 100. In fact, a better method would be to inscribe the JS file (business logic) on a Sat, and then use 100 different Sat inscribed with HTML to reference (or call recursion) the Sat where the JS file is located to generate the inscription. This would be more concise.
b. Lianliankan Game
The content you provided is:
Source: ord.io/18201467
As shown in the figure, this game is a 3*4 digit grid (this is the simple mode, the complex mode is a 6*6 digit grid). Two squares can be clicked at a time. When the images on the two squares are the same, they are fixed and displayed. If they are different, they are directly displayed as question marks. The game is completed within a certain number of clicks to test the player's short-term memory. This game is similar to the familiar game of Lianliankan. The JS and HTML of this game are all engraved in this Sat, but it references a "background image" (background image as shown below), so it is a simple application of recursive inscription.
The content you provided is:
Source: ord.io/18201467
c. MUD Game
Sorry, I am unable to translate the content as it contains HTML tags and a link that cannot be omitted. Please provide me with the text content only.
Descent into Darkness is a text-based role-playing game that combines classic MUD game elements and ordinals technology to provide players with a unique gaming experience.
In Descent into Darkness, players will play as an adventurer seeking a way out in the darkness. The game features monsters, quests, and boss battles. Players need to fight against monsters to complete quests, unlock new tasks, and obtain gold to upgrade equipment and purchase items.
The above three single-player H5 games are very simple applications. As games, they are incomplete. The processes of starting, playing, and ending the games are not recorded on the blockchain, and the game progress cannot be saved. After the game is over, there is no change to Sat's inscription. Only the game logic is defined, and the game state is not saved. This is just a preliminary attempt at BTC chain games.
The content you provided is:
Source: https://twitter.com/btcpixelwar
BTC PixelWar is a BTC-based multiplayer game that claims to be the first of its kind on the BTC blockchain. Participants create on a 256*256 pixel canvas, where they can directly click on pixels or upload images to generate pixels on the canvas. Each submission generates an inscription of the latest state of the canvas, which references the previous inscription state, creating a recursive chain. This may be the most recursive project on the market and a significant application in the field of recursive inscriptions.
This project proposes a new standard, "BRC721Cofound", which uses recursive inscriptions to allow all Bitcoin users to collaborate on the same canvas and record their process. Each moment is represented by an inscription that depicts the current state of the canvas created together, called a "moment inscription". It includes newly added or updated pixels at this time, as well as references to previous "moment inscriptions" and "code inscriptions" that handle image changes between two moments. Considering that many people may participate in painting together, rendering the latest canvas state requires deep recursion to load pixels drawn by each person. However, this process may cause delays in loading time. To solve this problem, "code inscriptions" are designed to take a snapshot of the latest canvas state after the current "moment inscription" is rendered. Then, this snapshot is stored in the DOM tree of the current "moment inscription". Therefore, sequential browsers can simplify the rendering process by caching the DOM tree of each rendered "moment inscription", reducing the recursion depth.
Overall, BTC PixelWar is an innovative and iconic BTC multiplayer game that enables collaborative creation while optimizing the rendering process. The introduction of the "BRC721Cofound" standard opens up new possibilities for multiplayer game applications on the Bitcoin chain and showcases the potential of recursive inscription in the gaming and social fields.
Recursive inscriptions have opened the era of Chain Inscriptions 2.0, making the gameplay of BTC NFT increasingly diverse. It is becoming more and more possible for BTC NFT to take a completely different path from NFT on other chains such as Ethereum. The future imagination/narrative space is vast.
The recursive inscription connects previously independent inscriptions, allowing them to reference each other and form a complex database structure. In previous articles, we discussed various derivative protocols based on Ordinals. In fact, when combined with recursive inscriptions, these protocols can read other inscriptions and update their own state based on their intelligent instructions, allowing for direct manipulation of the protocol's state through indexing. This creates a coherent set of actions similar to the effects of smart contracts.
At the same time, the vast recursive inscription database provides more operational and imaginative space for inscriptions, including metadata from various fields such as basic data, knowledge base, code library, function library, etc. They can refer to each other directly, realizing the application of complex logic. Therefore, we can expect the deep adoption of recursive inscriptions in fields such as generative art, blockchain gaming, metaverse, etc. We believe that killer applications of the future are brewing.
At the same time, recursive inscriptions also face some challenges:
1. If the recursion level increases, such as increasing to ten thousand levels of recursion, can the relevant parsers for chain rendering parse quickly?
2. If the number of referenced inscriptions increases, such as if a Sat simultaneously references ten thousand inscriptions, can the relevant parsers for off-chain rendering quickly parse them?
If these two points can be achieved, theoretically, the recursive inscriptions generated by games or NFTs can be infinitely complex and precise. These two issues are limited by the BTC network itself and are difficult to solve fundamentally, but they can be implemented through indirect technical solutions.
The recursive upgrade in the Ordinals protocol allows inscriptions to interact with each other, enabling new and exciting use cases. With this feature, the generation of art, on-chain displays, and efficient storage have become a reality. We can see that developers within the BTC ecosystem continue to create and develop in various directions such as chain games and generative art. Works based on recursive inscriptions are emerging one after another, and various components of a large project are slowly coming together. In the future, we can expect the birth of projects with complex product logic such as on-chain games, metaverse, interactive generative art, and more.
Reference:
https://github.com/1nftopia/brc721cofound
https://github.com/1nftopia/brc721auto/tree/main
https://medium.com/@gryphsisacademy/diving-into-ordinals-how-to-bet-on-bitcoin-ecosystem-as-halving-approaches-3486db8cbf12
Original link
Welcome to join the official BlockBeats community:
Telegram Subscription Group: https://t.me/theblockbeats
Telegram Discussion Group: https://t.me/BlockBeats_App
Official Twitter Account: https://twitter.com/BlockBeatsAsia