Nostr-native state on Bitcoin

State that leaves a trail.

Blocktrails let you anchor evolving state to Bitcoin using nothing but keys and hashes. Each state update creates a new output. Bitcoin's UTXO model guarantees only one valid history exists. No extra tokens. No sidechains. No new consensus rules. A primitive you extend — define tokens, voting, audit trails through Profiles.

$ npm install blocktrails
A primitive you extend No extra tokens No sidechains No new consensus rules

How It Works

Each state transition adds a tweak to the previous key, forming a cryptographic chain that mirrors the spend chain. Anyone with the state history can verify the chain.

  1. 1

    Hash your state with the previous public key to get a tweak value

  2. 2

    Add the tweak to your previous private key

  3. 3

    The resulting public key becomes a P2TR output

  4. 4

    To update state, spend and chain to the next key

trail.js
import { Blocktrail } from 'blocktrails';

// Create a trail with your Nostr key
const trail = new Blocktrail(privateKey);

// Commit state → get P2TR address
const genesis = trail.genesis('{"balance": 1000}');
console.log(genesis.p2trAddress); // bc1p...

// Advance state → new address
trail.advance('{"balance": 900}');

Why Nostr-Native?

Blocktrails use full secp256k1 keys internally — the same keys Nostr uses. Your existing Nostr identity can control a Blocktrail directly. No awkward key conversions. No parity headaches. The x-only encoding required by Taproot is handled only at the Bitcoin boundary.

Minimal

One P2TR output per state update. Key-path spends only. No scripts.

SPV-Compatible

Verify with merkle proofs. No full node required.

Composable

A primitive, not a protocol. Define your own state format and rules.

No Extra Tokens

Just Bitcoin. No wrapped assets, no bridges, no new consensus.

Comparison

How Blocktrails compares to other Bitcoin state protocols:

BlocktrailsRGBTaproot Assets
ComplexityMinimalHighMedium
ValidationClient-sideClient-sideClient-side (proof data via Universes)
State modelLinear chainDAGAsset tree
On-chain footprint1 P2TR output1 output + commitment1 output + witness
Key modelNostr-nativeCustomCustom
Best forSimple state machinesComplex contractsAsset issuance

Use Cases

Blocktrails are a building block. Applications define what state means:

Token ledgers

Version control

Voting systems

Audit trails

Game state

IoT logs

Any linear state machine

How is this different from RGB or Taproot Assets?
RGB and Taproot Assets are full protocols with complex validation layers. Blocktrails is a minimal primitive — just key tweaking and spend chains. You build your own rules on top. Think of it as the simplest possible state anchoring.
Where is the state stored?
Off-chain. Bitcoin only stores the commitment (the output key). You need the actual state bytes to verify, but they can live anywhere — git repos, IPFS, Nostr relays.
What prevents invalid state transitions?
Client-side validation. Verifiers check that each transition follows the rules your application defines. Bitcoin enforces ordering and prevents double-spends.
Can I define my own state format?
Yes — that's the point. Blocktrails is a primitive, not a protocol. The spec defines Profiles for application-specific rules. MRC20 defines fungible tokens. Monochrome defines generic state machines. Git-mark anchors git commits to Bitcoin. You can create your own profile for voting, attestations, game state — anything that fits a linear state model. The base layer never changes.
Do I need to run a full node?
No. Blocktrails are SPV-compatible. You only need output keys and merkle inclusion proofs.
Is there a reference implementation?
Yes. npm install blocktrails — JavaScript/Node.js with full test suite. See the GitHub repo.

A primitive you extend.