Inscription size = gas budget
Every inscription on Bitcoin pre-pays execution resources:- Gas is directly proportional to the size of the inscription in bytes
- Larger inscriptions allow more computation and state changes
- Each byte of inscription data grants a fixed gas allowance
- There is no dynamic pricing — execution cost is baked into the transaction size and Bitcoin fee
How to think about optimization
On Ethereum, optimization means reducing gas consumption to lower ETH spend. On BRC2.0, optimization means reducing inscription byte size to lower Bitcoin fees and fit more logic into a given cost envelope.Minimize calldata
Minimize calldata
Use tightly packed ABI encoding. Avoid passing large strings or arrays when a compact representation will do. Where the protocol supports it, compress calldata using NADA or ZSTD — compression often reduces fees by 3–5x for typical calldata patterns.
Reuse precompiles
Reuse precompiles
The BRC2.0 environment provides precompiled contracts for common operations (BIP-322 verification, Bitcoin transaction introspection, etc.). Calling a precompile consumes far fewer gas units than reimplementing the same logic in Solidity. Prefer precompiles wherever they are available.
Compact bytecode
Compact bytecode
Smaller contract bytecode means a smaller deployment inscription and lower deployment cost. Use Solidity’s optimizer, avoid unused functions, and consider splitting large contracts into smaller, focused modules.
Compress calldata with NADA or ZSTD
Compress calldata with NADA or ZSTD
For operations with large payloads (batch operations, bulk data), applying NADA or ZSTD compression before inscribing can reduce inscription size by 3–5x. The module decompresses the data before execution, so your contract receives normal ABI-encoded calldata.
Padding to increase gas budget
Sometimes your calldata is small, but the operation itself requires more computation than the inscription size allows. For this case, you can add JSON padding to the inscription to increase the gas budget without changing the logical content of the call.Rough cost envelopes
Costs scale with two factors:- Byte size of the inscription
- Bitcoin network fee rate at time of submission
| Operation | Approximate inscription size | Notes |
|---|---|---|
| Simple token transfer | ~100 bytes | Very inexpensive |
| Complex contract call | ~500–2,000 bytes | Depends on calldata |
| Contract deployment (small) | ~1–10 KB | Depends on bytecode size |
| Contract deployment (large) | ~10–100 KB | Can be significant |
| Compressed large call | 3–5x smaller than uncompressed | Use NADA or ZSTD |
These are guidelines, not guarantees. Actual costs depend on the Bitcoin fee rate at the time you submit. Estimate gas requirements before inscribing by simulating the execution off-chain.
Key principles
No gas price logic in contracts
Because there is no dynamic gas price, contracts that usetx.gasprice for:
- Anti-front-running logic
- Fee estimation
- Dynamic pricing mechanisms