MezcalProtocol documentation

Bitcoin mainnet · fungible tokens · OP_RETURN JSON

Mezcal, poured into an OP_RETURN.

A Mezcal transaction says what it means in plain UTF-8 JSON. One output carries the instruction, the other outputs carry the balances, and an indexer replays both to decide who owns what.

A Mezcal transaction at a glance Transaction inputs carrying Mezcal balances flow into a transaction. One OP_RETURN output holds the JSON instruction. The remaining outputs receive the allocated balances, and any unallocated remainder follows the pointer. Inputs balances being spent Mint or etch new units, if any Unallocated pool, per id OP_RETURN output {"p":"https://mezcal.sh", "edicts":[["1:0","100",1]]} edicts vout 1 100 units vout 2 remainder
Every confirmed Mezcal transaction resolves in one pass: inputs and new units form an unallocated pool, edicts move units to outputs, and whatever is left follows the pointer.

At a glance

Chain
Bitcoin
Network
mainnet
Carrier
OP_RETURN push data
Encoding
UTF-8 JSON
Asset id
block:tx
Genesis block
898750
Divisibility
0 to 18
Amount range
u128

Mezcal did not originate at Bitcoin Universe. The protocol and its reference indexer are the work of bitapeslabs/mezcal, and mezcal.sh is the project's own site. This repository documents the protocol as the ecosystem uses it, and marks every Universe-specific decision as such.

Who this is for

Wallet and app developers

Build a payload that survives

The specification gives the exact grammar and every condition that turns a transaction into a cenotaph. The validator checks a draft payload before you spend a satoshi on it.

Indexer implementers

Match the reference behaviour

The reference covers ordering, allocation, burns, confirmation, and reorg handling. The test vectors give valid and invalid payloads with the outcome each one must produce.

Holders and traders

Read the transaction you sign

The guide walks an etch, a mint, a transfer, and a burn line by line, so you can tell where a balance is going before the transaction is broadcast.

The shape of a payload

A Mezcal instruction, a mezcalstone, is one JSON object. The protocol tag is required. Everything else is optional, and a transaction may combine an etching, a mint, and edicts in a single object.

{
  "p": "https://mezcal.sh",
  "edicts": [ ["899284:20", "7700000000", 0] ],
  "mint": "898750:0",
  "etching": { "mezcal": "taco", "symbol": "🌮", "divisibility": 8,
               "premine": "0", "terms": null, "turbo": true },
  "pointer": 2
}

An edict is a triple: the asset id, the amount in base units as a decimal string, and the output index that receives it. Amounts are always base units, never display units, so 77 units of an asset with 8 decimals is written "7700000000".

Marketplace transfers in Bitcoin Universe use one exact form. A purchase built by the Core marketplace carries {"p":"https://mezcal.sh","edicts":[[ticker,baseUnits,0]]} derived from the verified listing, and the server refuses any payload that differs from it by a single byte. See Core marketplace behaviour.

Bitcoin Universe support

Bitcoin Universe indexes Mezcal and shows it across its products. Every claim below is taken from the org's own code, not from a roadmap.

Support declared in the Core protocol registry (backend/packages/ecosystem-contracts/lib/protocols.js) and its marketplace policy.
SurfaceStateWhat that means
Discovery and explorerAvailableView assets, holders, activity, and transactions.
Marketplace mutationsRead-onlyThe registry sets Mezcal marketplace availability to read-only. List, update, unlist, and buy are declared unsupported until authoritative ownership, transferability, builder, signed-transaction validation, broadcast, settlement, and reorg recovery are deployed and proven.
WalletDeclaredView, send, and receive are declared capabilities of the wallet surface.
Token explorer indexingAvailableConfirmed deployments, mints, transfers, burns, and holder balances, verified against Bitcoin Core before publication. There is no complete mempool feed, so coverage is reported as partial.

See the full support matrix, including the exact code paths behind each row.

Entry points

Reporting a problem

Report a documentation error as a GitHub issue on this repository. Report a security issue privately through GitHub private vulnerability reporting on this repository, and read SECURITY.md first. A protocol-level flaw in Mezcal itself belongs upstream at bitapeslabs/mezcal.