Under the Hood of SteemBiota: Architecting Decentralized Breeding & On-Chain Kinship 🧬💻
Hey Steem Devs!
If you’ve explored SteemBiota, you know it’s an open-source, client-side dApp running entirely on the Steem blockchain with zero backend servers or custom databases. Today, let's dive into the technical design and architectural flow behind one of its most complex features: Pet Breeding and Kinship Verification.
🧬 [ Parent A ] + [ Parent B ]
│
▼ Breadth-First Search (BFS)
[ Kinship Check ] ──▶ [ Genome Crossover & Mutation ]
│
▼
[ Offspring Post ] ──▶ On-Chain json_metadata
1. Deterministic Genomes & Genetic Crossover
Every creature is driven by a 10-integer genome array stored directly within json_metadata.steembiota.genome. When two creatures breed, the offspring genome isn't randomly generated from scratch. Instead, it computes deterministic genetic crossovers from Parent A and Parent B while factoring in the MUT (mutation tendency) gene to scale potential gene shifts. If the resulting genome crosses species boundaries, the dApp handles a Speciation event and assigns a new procedural genus name.
2. On-Chain Kinship Graph Verification (BFS)
To enforce diversity and prevent same-bloodline farming, SteemBiota executes an on-chain kinship check prior to dispatching a breed transaction:
- Graph Traversal via BFS: When two parents are paired,
checkBreedingCompatibility()initiates a Breadth-First Search (BFS) up to twelve generations deep to build an in-memory ancestry graph.
- IndexedDB Multi-Tier Caching: To avoid slamming public Steem RPC nodes with redundant requests, fetched ancestor posts are cached locally in IndexedDB. Results from early URL checks are reused at final submission time.
- Handling Phantom Ancestors (Severed Lineage): What happens if an ancient ancestor post was deleted on-chain? Instead of throwing a hard error and permanently breaking downstream breeding,
fetchAncestorsflags the missing node as{ severed: true }. Traversal continues past the gap, and the resulting child post is safely stamped with_severedLineage: truein its metadata!
3. Asynchronous Guard Checkpoints & Race Conditions
Because walking deep parent lineage over public RPC endpoints takes multiple seconds, users might navigate away or switch parents mid-fetch. To prevent stale async data from polluting component state, the kinship engine relies on monotonic generation counters (_loadGeneration). Checkpoints verify _loadGeneration !== currentGen after every major RPC resolve stage, immediately aborting stale promises before writing to Vue state.
4. Permlink Uniqueness & Anti-Collision
For breed permits and transfer handshakes, every reply permlink is generated via a timestamped slug helper (buildPermlink()). Appending Date.now() prevents permlink collisions when two users interact multiple times over long periods, eliminating "permlink already exists" node rejections.
Join the Development & Contribute!
SteemBiota is built with pure Vue 3 (CDN), Vue Router 4, steem-js, and standard HTML5 Canvas without complex build tools or bundlers.
Check out the code, inspect the genome mechanics, or open a pull request on GitHub:
🐙 GitHub Repository: https://github.com/puncakbukit/steembiota
🌐 Live dApp: https://puncakbukit.github.io/steembiota
Huge shoutout to Steem-dev community for contributing to this architecture to the Steem ecosystem. What are your thoughts on client-side graph traversal for dApps? Let's discuss in the comments!
Assisted by https://Gemini.google.com/
See also:
- By eliminating downvotes, Blurt ensures users are rewarded based on positive consensus, not through whale punishment. Please join through this link or this link with the invite code "puncakbukit."
- 🌀 SteemTwist — Steem with a Twist
- 🧬 Introducing SteemBiota — Raise, Breed & Evolve Creatures on the Steem Blockchain!
- 🎮 Reversteem — Play Reversi on the Steem Blockchain!
- @steem.amal: Charity At Your Fingertips
- Maximize curation rewards: follow our trail! Maksimalkan reward kurasi: ikuti trail kami! トレイルをフォローし、キユレーション報酬を最大化!

I haven't kept up with my game play there because of time constraints, but I think this two-tier development style for lightweight apps should be very valuable for Steem, so thank you for creating this app.
This demonstration of github pages as a Steem front-end was actually one of the inspirations behind the animalCards game that I'm currently working on.
Upvoted! Thank you for supporting witness @jswit.