How Recursive Inscriptions Actually Work
A Practical Guide to 95% Cost Reduction on Bitcoin Ordinals
Abstract
Recursive inscriptions are a technique for dramatically reducing inscription costs by storing shared data once and referencing it multiple times. This guide explains the technique with working code, real examples, and cost analysis. No experimental protocols required.
This is a Working Technique Available Today
- Works with standard Ordinals protocol
- Supported by all major wallets and marketplaces
- Used by multiple mainnet collections
- No special protocols or infrastructure needed
The Problem: Redundant Data Costs
Traditional Ordinals inscriptions duplicate data across every NFT:
- Average NFT size: 20 KB
- Total data inscribed: 200 MB
- Cost at 20 sat/vB: ~$15,000-25,000
- Problem: Same backgrounds, bodies, accessories repeated thousands of times
The Solution: Parent-Child References
How It Works:
- Inscribe shared traits once as "parent" inscriptions
- Create small child inscriptions that reference parents
- Wallets/marketplaces compose the final image
Visual Example:
Traditional Method (20 KB each):
NFT #1: [Background] + [Body] + [Hat] + [Eyes] = 20 KB
NFT #2: [Background] + [Body] + [Hat] + [Eyes] = 20 KB
NFT #3: [Background] + [Body] + [Hat] + [Eyes] = 20 KB
Total: 60 KB for 3 NFTs
Recursive Method:
Parent Inscriptions (one-time):
- Background Red: 5 KB (inscription abc123...)
- Body Akita: 5 KB (inscription def456...)
- Hat Crown: 3 KB (inscription ghi789...)
- Eyes Blue: 2 KB (inscription jkl012...)
Child NFTs (400 bytes each):
NFT #1: {"refs": ["abc123", "def456", "ghi789", "jkl012"]}
NFT #2: {"refs": ["abc123", "def456", "ghi789", "jkl012"]}
NFT #3: {"refs": ["abc123", "def456", "ghi789", "jkl012"]}
Total: 15 KB (parents) + 1.2 KB (children) = 16.2 KB
Savings: 73% for just 3 NFTs (improves with scale!)
Working Code Examples
1. Inscribe Parent Traits (One-Time)
# Inscribe each trait once
ord wallet inscribe --fee-rate 20 --file backgrounds/red.png
# Returns: abc123...i0
ord wallet inscribe --fee-rate 20 --file bodies/akita.png
# Returns: def456...i0
ord wallet inscribe --fee-rate 20 --file hats/crown.png
# Returns: ghi789...i0
2. Create Child NFT (SVG Reference)
<!-- child-nft-001.svg (only 400 bytes!) -->
<svg width="500" height="500">
<image href="/content/abc123...i0" width="500" height="500"/>
<image href="/content/def456...i0" width="500" height="500"/>
<image href="/content/ghi789...i0" width="500" height="500"/>
</svg>
# Inscribe the child
ord wallet inscribe --fee-rate 20 --file child-nft-001.svg
# Cost: ~$0.30 instead of $15!
3. JSON Metadata Approach
{
"name": "Akita #001",
"attributes": [
{"trait_type": "Background", "value": "Red", "inscription": "abc123...i0"},
{"trait_type": "Body", "value": "Akita", "inscription": "def456...i0"},
{"trait_type": "Hat", "value": "Crown", "inscription": "ghi789...i0"}
]
}
Real Cost Analysis
10,000 NFT Collection Costs (November 2024 Rates)
| Method | Data Size | Cost @ 20 sat/vB | Savings |
|---|---|---|---|
| Traditional | 200 MB | $20,000 | - |
| Recursive (200 traits) | 1 MB + 4 MB | $500 + $400 | 95.5% |
Break-even point: Recursive becomes cheaper after ~20 NFTs
JavaScript Implementation
// Generate recursive inscription references
function createRecursiveNFT(traits) {
const svg = `<svg width="500" height="500">\n`;
traits.forEach((traitId, index) => {
svg += ` <image href="/content/${traitId}" `;
svg += `x="0" y="0" width="500" height="500"/>\n`;
});
svg += `</svg>`;
return svg;
}
// Example usage
const nft = createRecursiveNFT([
'abc123...i0', // Background
'def456...i0', // Body
'ghi789...i0' // Accessory
]);
// Result: 400-byte SVG instead of 20KB image
Who's Using This Today
- Bitcoin Frogs - Saved ~90% on reinscription
- Ordinal Maxi Biz - Recursive traits system
- Multiple Generative Collections - Standard practice for 1K+ collections
Note: These projects use the recursive technique, not necessarily "Sparkle Protocol"
Limitations & Considerations
Important Considerations:
- Initial Cost: Must inscribe all parent traits first
- Marketplace Support: Not all marketplaces render recursive inscriptions (yet)
- Complexity: More complex than simple image inscriptions
- Best For: Collections with 100+ items sharing traits
- Not Ideal For: Unique 1/1 art pieces
Step-by-Step Tutorial
Step 1: Prepare Your Traits
traits/
├── backgrounds/
│ ├── red.png (5 KB)
│ ├── blue.png (5 KB)
│ └── green.png (5 KB)
├── bodies/
│ ├── akita.png (8 KB)
│ ├── shiba.png (8 KB)
│ └── husky.png (8 KB)
└── accessories/
├── crown.png (3 KB)
└── collar.png (2 KB)
Step 2: Inscribe Parent Traits
# Create a script to inscribe all traits
for file in traits/**/*.png; do
ord wallet inscribe --fee-rate 20 --file "$file" >> parent_ids.txt
done
Step 3: Generate Child NFTs
# Python script to generate combinations
import json
import random
parent_ids = json.load(open('parent_ids.json'))
for i in range(10000):
nft = {
'background': random.choice(parent_ids['backgrounds']),
'body': random.choice(parent_ids['bodies']),
'accessory': random.choice(parent_ids['accessories'])
}
# Create SVG reference
svg = create_recursive_svg(nft)
with open(f'nft_{i:04d}.svg', 'w') as f:
f.write(svg)
Tools & Resources
- Ord 0.19.0+ - Native recursive inscription support
- ord.io - Renders recursive inscriptions
- Ordinals.com - Full recursive support
- UniSat Wallet - Shows composed images
- OKX Wallet - Recursive inscription compatible
Conclusion
Recursive inscriptions are a proven technique available today that can reduce inscription costs by 90-95% for collections with shared traits. This technique:
- Works with standard Ordinals protocol
- Is supported by major wallets and marketplaces
- Has been proven on mainnet by multiple projects
- Requires no experimental protocols or special infrastructure
Start using recursive inscriptions today to save thousands of dollars on your collection.