Sidechain slot 9 · Skydoge testnet
HIVEMIND
Prediction markets on Skydoge. Truthcoin, in C++, as a sidechain.
Warning
TESTNET ONLY. This runs on the Skydoge testnet. Coins here have no value, the chain can be reset without notice, and the software is experimental. Do not put anything you care about into it.
Hivemind is Paul Sztorc's Truthcoin design: a blockchain whose job is to decide what actually happened, and to let people trade on it beforehand. Skydoge carries it as a sidechain, so the markets settle against a chain secured by Skydoge's own proof of work rather than by a company.
01What it does
BRANCHES
A branch is a rulebook: how long voting lasts, what listing costs, how much disagreement is tolerated before a result is thrown out.
DECISIONS
A decision is a question with an answer the world will eventually know. Voters are paid to report it honestly and penalised for drifting from everyone else.
MARKETS
A market lets you buy and sell shares in those answers. The price is the crowd's estimate, and it moves as people put money behind opinions.
SETTLEMENT
When the question resolves, shares in the correct answer pay out and the rest expire. No arbiter, no appeal to a company.
02The price engine, live
Every Hivemind market is priced by an automated market maker: the
logarithmic market scoring rule, LMSR. There is no order book and no
counterparty to wait for — a formula quotes a price for every share, and
each purchase nudges it. The instrument below runs the textbook LMSR for a
YES/NO question entirely in your browser. It is not connected to the chain and
sends nothing anywhere; the authoritative numbers for a real market always come
from listtrades.
How much money it takes to move the price. Also the maker's worst-case loss, B·ln 2.
Fresh market. Nobody has bought anything, so the maker quotes 50.0% for YES. Buy something and watch the price move.
The formula behind the curve
Cost function: C(q) = B · ln( eqYES/B + eqNO/B ).
The price of YES is its share of that sum: pYES = eqYES/B / ( eqYES/B + eqNO/B ).
A trade costs C(after) − C(before), so buying a lot at once is priced by the whole stretch of the curve you cross, not the price where you started.
“Paid into market” is C(q) − C(0), and C(0) = B·ln 2 is the most the maker can ever lose. Shares and coins here are abstract units.
03How it attaches to Skydoge
It is a drivechain sidechain in slot 9. Coins move onto it by a deposit on the Skydoge chain, and its blocks are carried by Skydoge miners through blind merged mining — miners commit to sidechain blocks without having to run or understand the sidechain themselves.
Illustration of the rhythm described below: at most one sidechain block per mainchain block, in practice roughly every other.
- SIDECHAIN SLOT
- 9
- MAINCHAIN
- Skydoge testnet
- BASED ON
- LayerTwo Labs' Hivemind, itself a Bitcoin Core fork
- BLOCK RATE
- One sidechain block per mainchain block at most. In practice roughly every other block, because a bid is only mineable in the block immediately after the tip it was made for.
04What works, and what does not
Stated plainly, because the useful thing for a tester is knowing where the edge is.
| Capability | State |
|---|---|
| Deposit from the Skydoge chain into the sidechain | works |
| Blind merged mining, blocks advancing unattended | works |
| Several nodes syncing, each validating against its own Skydoge node | works |
| Creating a branch decision | works |
| Creating a market on a decision | works |
| Recording a buy or sell order | works |
| Paying for the shares you buy | not implemented — shares are free |
| Share counts and LMSR prices | works — fixed in this build |
| Withdrawing back to the Skydoge chain | works — paid out, round trip proven |
| Sealed and revealed voting on outcomes | works — votes recorded on chain |
| Resolving those votes into a result | not implemented — see below |
| Settlement and payout | not implemented — see below |
| Reading an outcome back through the RPC | works — fixed in this build |
So: the chain works. Deposits, mining, syncing and withdrawals all do what they should, and you can create markets, place orders and cast votes, all recorded on chain. What is not built is the part in between: shares are not paid for, votes are not resolved into an answer, and nothing pays out. The plumbing is real; the market economics are not there yet. If a page anywhere claims otherwise, it is wrong.
The round trip is proven. Coins were deposited from the Skydoge chain, traded on the sidechain, and withdrawn back. The withdrawal was bundled with nine others, the bundle was accepted by the Skydoge chain, miners voted it up over 131 blocks, and it paid out — ten separate destinations funded in one mainchain transaction, with the remainder returned to the sidechain's own balance. That is the whole drivechain loop working, not a simulation of it.
Shares currently cost nothing. A market will quote you a price and record your order, but the purchase price is never collected. We measured it: buying five shares at a quoted total of 4.99 coins cost 0.01 — the transaction fee, and nothing else. There is no per-market account holding trader funds, so there is no pool of money for a market to pay out of. Treat prices here as a simulation of a market, not a market.
Votes are recorded but not resolved. A sealed vote and its reveal both land on chain, and the miner does build an outcome record naming the right voter count and the right decision. But the parts that would turn votes into an answer are not filled in: the voter's identity is stored as an empty key, the vote itself is stored as the “no answer” sentinel rather than the value cast, and every computed field — the reputation updates, the certainty figures, the final decision values — comes back empty. Nothing calculates the consensus.
That is also why settlement has nothing to work with: the payout code looks up each decision's final value, finds none, and falls back to “unresolved”.
Why settlement does not work, precisely. When a market
matures, the miner calculates each trader's payout and writes it into the
block's coinbase. But the consensus rule that validates a block permits a
coinbase of only the fees plus deposit and withdrawal-refund amounts —
there is no allowance for market payouts. So the two halves disagree: the
miner pays out, and every node rejects the result as
coinbase pays too much. The paying half was written; the
permitting half never was.
We found this by maturing a real market on this chain. Getting there also turned up a crash: a loop in the payout code advanced the wrong counter and read past the end of an array, killing the node outright — and a node that died this way could not rejoin its own chain afterwards. Both are fixed in the build above; the crash properly, and the invalid-block problem by stopping the miner from constructing a block it knows will be refused. Implementing settlement needs the consensus rule written first, which is protocol work rather than a patch.
05Downloads
Linux x86-64. Built against glibc 2.14, so it runs on anything from about
2011 onward. Qt is linked statically, so hivemind-qt is a single
file with no Qt install needed.
The archive holds three files. Verify them after unpacking with
sha256sum -c SHA256SUMS:
0c086eb535c724c41427ef08f9ccc19441bf79d566fbea3775c724dd64ab0bf0 hivemindd 605d9f35d64b639bc915e569b1c20dc443e5613c52505bdf10ed0b77eb3286b4 hivemind-cli 61a3a36564d6d0e282d3610d29ad23fd2b1182e75d0e0c88cccd7a6587635590 hivemind-qt
06Before you start: you need a Skydoge node too
Warning
Hivemind talks to a Skydoge node over RPC at 127.0.0.1, and that address is hardcoded. The Skydoge testnet node must run on the same machine. A remote one cannot be used.
It also cannot use cookie authentication. Hivemind builds
its mainchain credentials from the rpcuser and
rpcpassword in its own config, so your Skydoge testnet
node must have those set to the same values.
In your Skydoge config, under a testnet section so your mainnet node is untouched:
[test] server=1 rpcuser=pick-something rpcpassword=pick-something-long
Then ~/.hivemind/hivemind.conf:
server=1 rpcuser=pick-something rpcpassword=pick-something-long mainchainrpcport=18332
Start the Skydoge testnet node first, let it sync, then:
./hivemindd -datadir=$HOME/.hivemind -daemon ./hivemind-cli -datadir=$HOME/.hivemind getblockcount
A seed node is compiled in, so it finds the network on its own. There is no
hivemind testnet — the slot-9 chain runs as hivemind's main
network, with the upstream seed list removed.
07Getting coins
There is no faucet. CPU-mine the Skydoge testnet — difficulty is low enough that a laptop finds blocks — then deposit into slot 9.
Warning · funds at risk
Use a legacy address for the deposit, or you will lose the
coins. getnewaddress returns a P2SH address by default.
A deposit to one of those produces an output your wallet reports as yours and
counts in getbalance, but which can never be spent —
silently, with no error, and the balance still looks right.
# a legacy address - note the empty label and the "legacy" type
ADDR=$(./hivemind-cli -datadir=$HOME/.hivemind getnewaddress "" legacy)
# the deposit string is s<slot>_<address>_<first 6 hex of sha256 of
# everything up to and including the trailing underscore>
PRE="s9_${ADDR}_"
SUM=$(printf '%s' "$PRE" | sha256sum | cut -c1-6)
skydoge-cli -testnet createsidechaindeposit 9 "${PRE}${SUM}" 25 0.001
The deposit is credited in a sidechain coinbase, so give it a few sidechain blocks before it appears.
08Making a market
Two gotchas
Two gotchas worth knowing before you fight them. Decisions and markets need
a legacy address, same as deposits. And createmarket's
liquidity, fee and commission arguments are integers in
satoshi, despite the help text calling them numeric — passing
0.01 fails with a misleading "JSON integer out of range".
CLI="./hivemind-cli -datadir=$HOME/.hivemind"
BRANCH=$($CLI listbranches | grep -m1 branchid | cut -d'"' -f4)
ADDR=$($CLI getnewaddress "" legacy)
$CLI createdecision "$ADDR" "$BRANCH" "Will it rain tomorrow?" 1000 false false
# take the decisionid from the reply, wait for a block, then:
$CLI createmarket "$ADDR" "$DECISIONID" 100000000 1000000 1000000 \
"Rain tomorrow" "Settles YES if it rains." "weather" 1000 0 0
# 100000000 = 1.0 coin of liquidity; 1000000 = 0.01
$CLI createtrade "$ADDR" "$MARKETID" buy 100000000 100000000 1
$CLI listtrades "$MARKETID"
Read positions from listtrades. That is the authoritative
record.
09Privacy
Our builds have the upstream seed list removed, so your node does not announce itself to anyone else's network on startup — it connects to the Skydoge slot-9 seed and nowhere else. The binaries are stripped and contain no build paths, usernames or e-mail addresses. This page loads no fonts, scripts or trackers from anywhere but this server.
10Reporting something broken
This is early software on a throwaway chain, and the interesting bugs are the ones nobody has hit yet. If your wallet reports a balance it will not let you spend, or a market price that looks impossible, that is worth telling us about — both of those were real bugs found and fixed on the way to this build.