Sonichain is a decentralized story-building game on Stacks where players contribute short voice memos to co-create evolving narrative chains. Rounds determine which contribution becomes canon, and contributors are rewarded with NFTs and an optional bounty pool once the story is sealed.
SoniChain is a voice-based blockchain game where players co-create stories block by block using their voices. Each voice clip becomes a “block” in the story chain voted on by the community, rewarded with NFTs, funded bounties, and sealed forever on the blockchain.
Sonichain is a collaborative storytelling game where players contribute voice memos to build evolving narrative chains. Here's how to get started and play:
- Register Your Username
- Call
register-user(username)to create your unique identity - Choose a username (max 50 characters) that hasn't been taken
- This links your wallet address to a memorable username
- Call
- Start a New Story
- Call
create-story(prompt, init-time, voting-window) init-timeis an epoch timestamp (uint) for when Round 1 startsvoting-windowis the per-round duration in seconds (epoch delta)- This creates Round 1 with
start-time = init-timeandend-time = init-time + voting-window - You become the story creator and can seal it later
- Example: "A mysterious door appears in the forest..."
- Call
-
Submit Voice Memos
- During any active round, call
submit-block(story-id, uri, now) - Upload your voice memo to IPFS or another storage service
- Provide the URI (max 256 characters) to your voice file
- You can only submit once per round per story
nowis an epoch timestamp (uint) used for timing validation
- During any active round, call
-
Vote on Submissions
- Call
vote-block(submission-id)to vote for your favorite submission - You get one vote per round per story
- Vote for the voice memo that best continues the story
- Voting is active during the round window
- Call
- Finalize Rounds
- After the voting window ends, anyone can call
finalize-round(story-id, round-num, now) nowis an epoch timestamp (must be > current round'send-time)- The submission with the most votes wins
- The winner receives an NFT containing the full story so far
- A new round automatically begins (unless max blocks reached) with
start-time = prior end-timeandend-time = prior end-time + voting-window
- After the voting window ends, anyone can call
-
Fund Bounties (Optional)
- Anyone can call
fund-bounty(story-id, amount)to add STX to the reward pool - This incentivizes participation and rewards contributors
- Funds are held by the contract until story sealing
- Anyone can call
-
Seal the Story
- Only the story creator can call
seal-story(story-id) - Requires at least 5 finalized blocks
- Distributes bounty equally among all contributors
- Takes a 2.5% platform fee
- Marks the story as complete and immutable
- Only the story creator can call
Timing:
- Rounds use epoch-based timing (no dependency on block height)
- Round 1:
[init-time, init-time + voting-window] - Round N+1:
[prev end-time, prev end-time + voting-window] - Minimum 5 finalized rounds required to seal a story
Rewards:
- Round winners get NFTs containing the full story
- All contributors share the bounty pool equally when story is sealed
- Platform takes 2.5% fee from bounty on sealing
Voting Rules:
- One vote per user per round
- One submission per user per round
- Winner determined by highest vote count
- Ties resolved by submission order
- Per-round submission cap: 10 submissions
- Per-story round cap: 10 rounds
- Alice creates story: "A robot discovers emotions"
- Round 1 opens - players submit voice memos continuing the story
- Players vote on submissions
- Bob's submission wins - he gets an NFT and Round 2 begins
- Process repeats for multiple rounds
- Alice seals the story after 8 rounds
- All contributors receive equal shares of the bounty pool
contracts/Sonichain.clar: Core protocol (stories, rounds, submissions, votes, bounty, sealing)contracts/Soni_NFT.clar: Minimal NFT used to reward round winners on finalization (mint the whole story to the winner)
Key parameters and limits (see Sonichain.clar):
MIN-BLOCKS-TO-SEAL: finalized rounds required to seal a story (u5)MAX-BLOCKS-PER-STORY: hard cap on rounds per story (u50 for legacy, flow stops at 10)MAX-ROUNDS-PER-STORY: enforced cap (u10)MAX-SUBMISSIONS-PER-ROUND: enforced cap (u10)PLATFORM-FEE-BPS: platform fee on sealing (u250)
- Create story:
create-story(prompt, init-time, voting-window)→ initializes metadata and Round 1 with epoch times - Submit block:
submit-block(story-id, uri, now)→ adds a voice memo to the current round (≤10 submissions/round) - Vote block:
vote-block(submission-id)→ one vote per user per round; increments submission and round tallies - Finalize round:
finalize-round(story-id, round-num, now)→ picks winner (highest vote-count), mints reward NFT, advances to next round (≤10 rounds/story) - Fund bounty:
fund-bounty(story-id, amount)→ anyone can fund; disbursed on sealing - Seal story:
seal-story(story-id)→ creator-only; validates minimum finalized blocks, charges platform fee, distributes bounty equally per finalized block
- NFT minting is triggered by round finalization and requires
Soni_NFTto authorize calls from theSonichaincontract. - Sealing distributes bounty equally per finalized block.
- Read-only helpers:
list-rounds(story-id)→ up to 10 round numberslist-round-submissions(story-id, round-num)→ up to 10 submission IDsis-voting-active-at(story-id, round-num, now)can-finalize-round-at(story-id, round-num, now)