This is an enhanced fork of the original ord project with full BRC20 and BRC2.0 protocol support.
ord is an index, block explorer, and command-line wallet for Bitcoin ordinals. This fork extends the original functionality with comprehensive BRC20 and BRC2.0 indexing capabilities.
- π― BRC20 & BRC2.0 Protocol Support: Full indexing and querying of BRC20 tokens and BRC2.0 programmable events
- π OPI Validation: Built-in validation against the Ordinals Protocol Index (OPI) specification
- π Extended Indexing: Support for Bitmap, BTC Domain, and inscription receipts
- π EVM JSON-RPC: Separate RPC server for BRC2.0 EVM endpoints
- π External Integration: Seamless integration with
brc20-progserver for programmable token logic
For detailed BRC20/BRC2.0 documentation, see README.brc20.md.
- Quick Start
- BRC20 & BRC2.0 Setup
- Installation
- Building from Source
- Configuration
- Extended Indexing Options
- Wallet
- Contributing
- Documentation
Before using this fork, ensure you have:
- A synced Bitcoin Core node with
-txindexenabled - The
brc20-progserver for BRC20/BRC2.0 functionality
# Start ord with BRC20 indexing
./ord \
--index-brc20 \
--index-addresses \
--brc20-prog-url http://127.0.0.1:18545 \
--brc20-prog-username user \
--brc20-prog-password password \
serverThe BRC20 functionality requires an external brc20-prog server.
Option A: Install via Cargo
cargo install brc20-progOption B: Build from Source
git clone https://github.com/bestinslot-xyz/brc20-programmable-module.git
cd brc20-programmable-module
cargo build --releaseSet up environment variables:
export BITCOIN_RPC_URL="http://127.0.0.1:8332"
export BITCOIN_RPC_USER="your_username"
export BITCOIN_RPC_PASSWORD="your_password"
export BITCOIN_RPC_NETWORK="mainnet" # or "signet"
export BRC20_PROG_RPC_SERVER_URL=127.0.0.1:18545
export BRC20_PROG_RPC_SERVER_ENABLE_AUTH=true
export BRC20_PROG_RPC_SERVER_USER=user
export BRC20_PROG_RPC_SERVER_PASSWORD=passwordStart the server:
brc20-prog -l infoFor detailed configuration options, see the brc20-prog documentation.
Using Command Line Flags:
./ord \
--index-brc20 \
--index-addresses \
--brc20-prog-url http://127.0.0.1:18545 \
--brc20-prog-username user \
--brc20-prog-password password \
serverUsing Environment Variables:
export ORD_INDEX_BRC20=true
export ORD_INDEX_ADDRESSES=true
export ORD_BRC20_PROG_URL=http://127.0.0.1:18545
export ORD_BRC20_PROG_USERNAME=user
export ORD_BRC20_PROG_PASSWORD=password
ord serverUsing Config File (config.yaml):
index_brc20: true
index_addresses: true
brc20_prog_url: http://127.0.0.1:18545
brc20_prog_username: user
brc20_prog_password: passwordEnable validation against the OPI specification:
Standard Validation (logs mismatches):
./ord \
--index-brc20 \
--opi-validation \
...Strict Validation (panics on mismatch):
./ord \
--index-brc20 \
--opi-validation \
--opi-validation-strict \
...You can configure OPI validation behavior using environment variables:
CHECKPOINT_INTERVAL - Controls validation frequency for historical blocks (default: 1000)
- Recent blocks (within 24 hours): Every block is validated
- Historical blocks (older than 24 hours): Validated every N blocks as checkpoints
- Lower values provide more frequent validation but slower sync
- Higher values provide faster sync but less frequent validation
OPI_API_URL - Specifies the OPI API endpoint (default: https://api.opi.network)
- Use this to connect to a custom OPI API server
- Useful for testing or using alternative OPI implementations
Example:
export CHECKPOINT_INTERVAL=500 # Validate every 500 blocks for historical data
export OPI_API_URL=https://custom.opi.server
./ord \
--index-brc20 \
--opi-validation \
--brc20-prog-url http://127.0.0.1:18545 \
--brc20-prog-username user \
--brc20-prog-password password \
serverValidation Strategy:
- Recent blocks (< 24 hours old): Validated at every height
- Historical blocks (> 24 hours old): Validated at checkpoint intervals
- Checkpoint height:
height % CHECKPOINT_INTERVAL == 0
Once the indexer is running, you can retrieve BRC20 event data through the API endpoints. BRC2.0 EVM endpoints are accessible via a separate RPC server that supports standard EVM JSON-RPC.
For detailed API documentation, see README.brc20.md.
Download pre-built binaries from the releases page.
Or install via command line:
curl --proto '=https' --tlsv1.2 -fsLS https://ordinals.com/install.sh | bash -sVerify installation:
ord --versionbrew install ordBuild the Docker image:
docker build -t okx/ord .Build a .deb package:
cargo install cargo-deb
cargo debOn Debian/Ubuntu:
sudo apt-get install pkg-config libssl-dev build-essentialOn Red Hat/CentOS:
yum install -y pkgconfig openssl-devel
yum groupinstall "Development Tools"curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shRequires rustc version 1.79.0 or later. Check your version:
rustc --versionUpdate if needed:
rustup updateClone the repository:
git clone https://github.com/okx/ord.git
cd ordTo build a specific version:
git checkout <VERSION>Build the release binary:
cargo build --releaseThe binary will be available at ./target/release/ord.
docker build -t okx/ord .ord requires a synced bitcoind node with -txindex enabled. If bitcoind is running locally with default settings, ord will auto-detect it.
For non-default configurations, use the appropriate flags. See ord --help for details.
ord communicates with bitcoind via RPC and requires authentication.
Using Cookie File (Default):
ord --cookie-file /path/to/cookie/file serverUsing Username/Password:
ord --bitcoin-rpc-username foo --bitcoin-rpc-password bar serverUsing Environment Variables:
export ORD_BITCOIN_RPC_USERNAME=foo
export ORD_BITCOIN_RPC_PASSWORD=bar
ord serverUsing Config File:
bitcoin_rpc_username: foo
bitcoin_rpc_password: barThis fork supports several extended indexing options for protocol-specific inscriptions.
--index-addresses to be enabled.
Index BRC-20 protocol inscriptions, including BRC20 token operations and BRC2.0 programmable events.
Requires: --index-addresses and external brc20-prog server
./ord \
--index-addresses \
--index-brc20 \
--brc20-prog-url http://127.0.0.1:18545 \
--brc20-prog-username user \
--brc20-prog-password password \
serverIndex Bitmap protocol inscriptions for on-chain bitmap images.
Requires: --index-addresses | Mainnet only
./ord \
--index-addresses \
--index-bitmap \
serverIndex BTC Domain protocol inscriptions and registrations.
Requires: --index-addresses | Mainnet only
./ord \
--index-addresses \
--index-btc-domain \
serverStore detailed inscription receipt data for protocol-specific queries and verification.
Requires: --index-addresses
./ord \
--index-addresses \
--save-inscription-receipts \
serverAll extended indexing options can be combined:
./ord \
--index-addresses \
--index-brc20 \
--index-bitmap \
--index-btc-domain \
--save-inscription-receipts \
--brc20-prog-url http://127.0.0.1:18545 \
--brc20-prog-username user \
--brc20-prog-password password \
serverEnvironment Variables:
export ORD_INDEX_ADDRESSES=true
export ORD_INDEX_BRC20=true
export ORD_INDEX_BITMAP=true
export ORD_INDEX_BTC_DOMAIN=true
export ORD_SAVE_INSCRIPTION_RECEIPTS=true
export ORD_BRC20_PROG_URL=http://127.0.0.1:18545
export ORD_BRC20_PROG_USERNAME=user
export ORD_BRC20_PROG_PASSWORD=password
ord serverConfig File:
index_addresses: true
index_brc20: true
index_bitmap: true
index_btc_domain: true
save_inscription_receipts: true
brc20_prog_url: http://127.0.0.1:18545
brc20_prog_username: user
brc20_prog_password: passwordord relies on Bitcoin Core for private key management and transaction signing.
- Bitcoin Core is not ordinal-aware: Using
bitcoin-clicommands directly may lead to loss of inscriptions - Automatic wallet loading:
ord walletcommands automatically load the wallet specified by--name(default: 'ord') - Segregate funds: Do not use
ordwith wallets containing significant funds. Keep ordinal and cardinal wallets separate
Alpha ord wallets are incompatible with previous versions. To migrate:
# From old wallet, send to new addresses
ord wallet send <amount> <address>
# Generate new addresses in new wallet
ord wallet receiveord uses env_logger for logging.
Enable logging:
RUST_LOG=info cargo run serverEnable debug logging with backtrace:
RUST_BACKTRACE=1 RUST_LOG=debug ord serverContributions are welcome! This project emphasizes proper testing with three categories:
- Unit tests: Located at the bottom of files in
testsmod blocks - Integration tests: End-to-end functionality tests in the tests directory
- Fuzz tests: Fuzzing structure in the fuzz directory
We recommend installing just for easier test execution:
# Run full CI test suite
just ciThis runs:
cargo fmt -- --check
cargo test --all
cargo test --all -- --ignoredjust fmt # Format code
just fuzz # Run fuzz tests
just doc # Build documentation
just watch ltest --all # Watch mode for testsWe follow TDD practices using a mocked Bitcoin Core instance (mockcore) for fast feedback loops.
If tests are failing or hanging, you may need to increase open file limits:
ulimit -n 1024- Official Ordinals Docs: docs.ordinals.com
- BIP: See bip.mediawiki for technical specification
- BRC20 Details: See README.brc20.md for BRC20/BRC2.0 specific documentation
- Project Board: GitHub Projects
- Discord: Join the Discord server
Documentation translations use mdBook i18n helper.
See the usage guide for details.
-
Install tools:
cargo install mdbook mdbook-i18n-helpers mdbook-linkcheck
-
Generate POT file:
MDBOOK_OUTPUT='{"xgettext": {"pot-file": "messages.pot"}}' mdbook build -d po -
Update translation file (replace
XXwith your language code):msgmerge --update po/XX.po po/messages.pot
-
Edit
msgstrstrings inXX.poto add translations -
Build translated docs:
mdbook build docs -d build MDBOOK_BOOK__LANGUAGE=XX mdbook build docs -d build/XX mv docs/build/XX/html docs/build/html/XX python3 -m http.server --directory docs/build/html --bind 127.0.0.1 8080
-
Commit
XX.poand open a pull request
See this example commit for reference.
Release commit messages follow this template:
Release x.y.z
- Bump version: x.y.z β x.y.z
- Update changelog
- Update changelog contributor credits
- Update dependencies
Ordinal theory imbues satoshis with numismatic value, allowing them to be collected and traded as curios.
Ordinal numbers are serial numbers for satoshis, assigned in the order in which they are mined, and preserved across transactions.
This is a fork of the original ord project by raphjaph and the ordinals community.
For information about the original project and its development, visit:
- Original Repository: https://github.com/ordinals/ord
- Official Site: https://ordinals.com
See LICENSE for details. This is experimental software with no warranty.