RiemaLabs / modular-indexer-light

A fully user-verified execution layer for Bitcoin's meta-protocols. (light indexer)
https://eprint.iacr.org/2024/408
57 stars 21 forks source link
bitcoin brc20 ordinals

Modular Indexer (Light) Join Nubit Discord Community Follow Nubit On X

Nubit Logo

Background

The Modular Indexer, which both includes the Committee Indexer and the Light Indexer, establishes a fully user-verified execution layer for Bitcoin's meta-protocols. By harnessing Bitcoin's immutable and decentralized nature, it offers a Turing-complete execution layer that transcends the constraints of Bitcoin's script language.

For a detailed understanding, refer to our paper: "Modular Indexer: Fully User-Verified Execution Layer for Meta-protocols on Bitcoin". Stay updated on the latest progress in our L1F Discourse Group.

What is Light Indexer?

Light Indexer plays a crucial role in this ecosystem. It retrieves the state of Bitcoin's meta-protocol from Committee Indexer according to the user's demand. While ensuring obtained states are trustworthy, it is efficient enough to be executed on browsers, mobiles, and other light devices.

Getting Started (Fast)

Linux & macOS

  1. Execute the following command:
sh -c "$(curl -fsSL nubit.sh)"

Windows

  1. Download light-indexer-windows-amd64.zip
  2. Unzip light-indexer-windows-amd64.zip.
  3. Double-click run.bat:
    • Enter a Bitcoin RPC (default is https://bitcoin-mainnet-archive.allthatnode.com), a valid gas coupon, and a desired indexer name, then start the indexer.
    • A private file containing the key will be generated in the light-indexer-windows-amd64 folder. Please keep it safe.

Getting Started (For developers)

1. Requirements

Before stepping into the installation, ensure your machine is equipped with the minimum requirements: (Easy to be met!)

Metric Minimum Requirements
CPU Single Core
Memory 512 MB
Disk 30 GB
Bandwidth Upload/Download 100 KB/s

2. Install Dependencies

Light Indexer is built with Golang. You can run your own one by following the procedure below. Go version 1.22.0 is required for running the repository. Please visit the Golang download Page to get the latest Golang installed.

3. Configuration Instructions

To set up Light Indexer, begin by copying the example configuration file.

cp config.example.json config.json
# Edit config.json according to your needs

Then, customize it to match your specific requirements as follows.

Detailed Configuration Instructions:

After copying the config.example.json and creating your config.json, more detailed information is required. Here's a brief outline of the necessary variables to be configured:

Setting Up report:

[!IMPORTANT] Nubit DA Layer is currently closed for revamps, please use --report=false to temporarily disable DA reporting. Stay tuned!

Set up this field to allow your Light Indexer to upload checkpoints to the Nubit DA Layer and participate in the Pre-Alpha Testnet! To get gasCoupon, please follow the guideline on the Nubit website.

Setting Up committeeIndexers:

[!IMPORTANT] Nubit DA Layer is currently closed for revamps, please leave "da" settings blank. Stay tuned!

As of now, the Light Indexer cannot automatically detect active Committee Indexers. Therefore, the default Committee Indexers that are recognized are those operated officially by Nubit, and they are provided by config.example.json.

Still, you could add information provided by committee indexer runners:

Setting Up verification:

Set up this field to change the verification process.

4. Running the Program

Run the commands below, and the Light Indexer will initiate API services and upload checkpoints to DA:

make
./modular-indexer-light

Please note: When initiating the Light Indexer, the system will automatically generate a private key and save it in the 'private' file located in the 'modular-indexer-light' directory. Ensure that you securely store this private key.

Basic Usage

Light Indexer is optimized for cost-efficiency. This design provides a user-friendly approach for those needing to interact with Bitcoin's meta-protocols (such as brc-20) without expensive data processing.

After successfully launching Light Indexer, you have several functionalities at your disposal. These capabilities can be accessed through direct API calls. The brc-20 balances provided by the Light Indexer are fully verified and trustworthy.

Useful Links

FAQ