Bitcoin Cemetery

this is the gitbook introduces how Bitcoin Cemetery works.

Bitcoin Cemetery is a cyber cemetery built on Bitcoin based on the Ordinals theory, providing a place where memories can be permanently preserved alongside Bitcoin. The technical implementation leverages recursive ordinals, utilizing endpoints provided by Ordinals to add a mutable aspect to inscriptions, which are otherwise immutable.

Why Build a Cemetery on Bitcoin?

In the 21st century, we lack reliable methods for commemorating things. No matter where we store what we want to remember, there is no way to ensure its truly permanent preservation. Bitcoin provides a promising solution to this problem. As the consensus around Bitcoin grows stronger, the most powerful consensus network in human history has been established. This decentralized network, where information is guaranteed to be tamper-proof, allows us to freely store the information we wish to record on the blockchain. Against this backdrop, creating a cemetery on Bitcoin as a foundational structure offers an interesting application for Bitcoin inscriptions.

By using r/children, we can ensure all the tombs can be seen in one single inscription.

Sturcture and implementation logic of Bitcoin Cemetery

Before explaining the implementation logic and structure of the entire cemetery, I need to introduce two important endpoints. The first endpoint is /r/content, and the second is /r/children.

Firstly, /r/content is the endpoint used to retrieve the content of an inscription, while /r/children is used to obtain the IDs of an inscription's child inscriptions. Using these two endpoints, we have designed the following structure for the cemetery:

1. Cemetery and Tombs

Above is the structural diagram of the cemetery tombstones.

The cemetery will have a grandmother inscription, which serves as the parent inscription for the cemetery and the cemetery will be presented in the following format:

  • add a cemetery

This format includes all the information required for the cemetery. With this structure, we can freely expand the cemetery.

The cemetery and tombstones contain a block field, which is tied to a specific Bitcoin block. Each tombstone corresponds to a specific block on the Bitcoin blockchain, meaning that the number of tombstones in the Bitcoin Cemetery is equal to the number of Bitcoin blocks. Each cemetery selects a block range before being deployed, and the block ranges of different cemeteries cannot overlap. Each cemetery can only have a fixed number of tombstones, with each block being used only once. The cemetery continuously retrieves the current Bitcoin block height to ensure that the maximum number of tombstones in the cemetery is in sync with the Bitcoin blockchain. Meanwhile, there is a field that includes "upside," "middle," and "downside," which correspond to inscriptions displayed as three scroll images, divided into upper, middle, and lower sections. These three assets are used for the view that appears when a tombstone is clicked. Upon clicking a tombstone, a modal window will appear. This modal is designed with a three-part scroll layout, enabling the webpage to seamlessly handle varying amounts of tombstone information. Whether the story is extensive or minimal, the modal can dynamically allocate a different number of middle sections to accommodate the content.

Our tombs are svgs. They are combinations that are from some patterns. The tombview_settings is telling where those patterns are and the background color.

And each cemetery will have different art style. They will have unique looks of surroundings and tombs.

  • add a tomb

This JSON structure is similar to that of the cemetery, containing all the necessary information for a tombstone. Through this structure, we can freely add corresponding tombstones to the cemetery.

2. Module Loading and Flexible Expansion for JS and Tombs

The modular design of this project allows for dynamic loading and management of pluggable features within the cemetery. For instance, the ModuleLoader class is used to initialize module loading, retrieve information about JavaScript modules, and display them accordingly. This design ensures that the functionality of the cemetery can adapt to changes flexibly, such as dynamically adding new modules or removing existing ones.

The module loader manages modules using two sets: modulesToAdd and modulesToDelete. It first retrieves all the child inscriptions using the /r/children endpoint and then determines, based on each inscription's type, whether the corresponding JavaScript module should be added or deleted.

The child inscription formats are as follows:

  • Adding a Module:

Here, type indicates that the operation is an addition (add), jsname is the name of the JavaScript file to be loaded, and js_id points to the inscription ID that contains the code.

  • Deleting a Module:

Here, type indicates that the operation is a deletion (delete), and js_id is the ID of the JavaScript module to be removed.

In ModuleLoader, these child inscriptions are processed and added to either the modulesToAdd or modulesToDelete set, ensuring that the system effectively manages which modules need to be loaded and which ones should be removed.

It is important to note that the functionality for adding or deleting tombstones is implemented through other functions, not by the ModuleLoader class.

Through this logic, we have implemented pluggable JavaScript animation loading.

At the same time, our tombstones have a similar error correction mechanism, which is used to remove maliciously uploaded tombstone information (e.g., someone maliciously uploading information about a living person or uploading discriminatory and offensive content through the cemetery).

The structure of the deletion mechanism is as follows:

  • delete a tomb

This JSON contains two identifiers: the cemetery ID and the tombstone ID. With this structure, every time the webpage is loaded, it also loads information about deleted tombstones. Whenever a user opens the cemetery, it iterates through the tombstones and removes the corresponding ones to ensure they are not displayed in the cemetery.

Summary of Bitcoin Cemetery Structure and Implementation

The Bitcoin Cemetery project leverages the Bitcoin blockchain to create a digital, immutable cemetery that stores memories and commemorative messages. Using the three-layer structure of grandmother inscriptions, cemetery inscriptions, and tombstones, the system ensures that the cemetery information is organized, expandable, and securely preserved on the blockchain.

The project incorporates key endpoints like /r/content and /r/children to manage inscriptions and their relationships. The block field ties each tombstone to a specific Bitcoin block, providing a one-to-one connection between the blockchain's growth and the number of tombstones, making the Bitcoin Cemetery truly unique. The modular design of the project, supported by the ModuleLoader class, allows for flexible addition and removal of JavaScript modules, enhancing the interactivity of the cemetery without compromising data integrity.

The cemetery also features an error correction mechanism to handle malicious content, ensuring that the information stored remains respectful and appropriate. This thoughtful approach to preserving memories ensures that the Bitcoin Cemetery will continue to evolve alongside the blockchain, creating a space that grows as Bitcoin does.

Last updated