# Fractal Social Hierarchy UTXO System with Universal Basic Income by Demurrage A population register and a UTXO payment layer. The register is a social hierarchy: your superior attested your identity. The hierarchy maps onto existing civil registration — countries, municipalities, individuals — but supports any trust model, from tribal to national. Being registered gives you universal basic income, claimable as UTXO. All UTXO values decay at 20% per YEAR — this decay is the UBI. The people vote for block validators. Each vote is a hash commitment. One vote is drawn randomly each block — the selected validator reveals the preimage, which seeds the random selection of the next. The secret votes prevent DoS attacks on block producers and provide the random number generator, all in one. Each UTXO also pays rent for its place in the trie, incentivizing consolidation and bounding state growth. --- ## People Tree ### Node ``` Node { key pubkey leaf bool children []hash nonce uint last_ubi uint last_vote uint tree_count uint tree_ubi uint } ``` A node is a person, a group of persons, or an organization. One key per node. A person contributes 1 to tree_count. A group represents multiple persons as a single node (contributes N). An org is a non-person entity (contributes 0 — no UBI). `tree_count` is the number of persons in the subtree, aggregated upward. Population = root.tree_count. A node's own person contribution is tree_count minus the sum of its children's tree_counts. `leaf` — if true, the node cannot have children. Set by the parent at creation. H(Node) = SHA-256(key || leaf || children || nonce || last_ubi || last_vote || tree_count || tree_ubi). ### UBI Each person accrues UBI continuously. Claimable amount at time T: ``` claimable(T) = contribution × TOKEN × (1 − decay^(T − last_ubi)) ``` TOKEN = 10^16 base units. `decay` is the per-second demurrage factor: the largest integer where `power(decay, YEAR) < 0.8 × SCALE`. This yields 9999999929290076. All exponentiation in the protocol uses binary exponentiation with floor rounding at every step, guaranteeing bit-reproducible results. A person accrues up to 1 TOKEN. A group of 5 accrues up to 5. An org: nothing. `tree_ubi` is normalized to `norm_time`. Unclaimed UBI at time T: ``` unclaimed_ubi(T) = tree_count × TOKEN − tree_ubi × decay^(T − norm_time) ``` ### Add ``` Add { parent pubkey child pubkey hash bytes[32] nonce uint — parent's nonce deadline uint — block time after which consent expires consent sig — child signs hash + deadline + parent pubkey sig sig — signed by parent } ``` Parent adds child. Subtree verified by hash. `last_ubi` and `last_vote` = block time for all nodes in the subtree. Increment parent's nonce. Recompute `tree_count` upward. Consent is invalid after the deadline — prevents replay of a previous consent after a Remove. ### Remove ``` Remove { parent pubkey child pubkey nonce uint — parent's nonce sig sig — signed by parent } ``` Child and its entire subtree are deleted from the tree. Accrued UBI for each person in the subtree is automatically minted as UTXOs to their respective keys. Increment parent's nonce. Recompute `tree_count` upward. ### Move ``` Move { child pubkey new_parent pubkey nonce uint — new parent's nonce deadline uint consent sig — child signs deadline + new_parent sig sig — signed by new parent } ``` Moves a child (and its entire subtree) from its current parent to a new parent. The old parent is looked up from the tree. State is preserved: `last_ubi`, nonce, subtree — nothing is reset. Increment new parent's nonce. Recompute `tree_count` upward for both old and new parent. ### Leave ``` Leave { child pubkey nonce uint — child's nonce sig sig — signed by child } ``` Same as Remove but initiated by the child. The parent is looked up from the tree. Increment child's nonce. Recompute `tree_count` upward. ### Rekey ``` Rekey { old pubkey new pubkey nonce uint sig sig — signed by old key } ``` Changes a node's key. Increment nonce. --- ## UTXO Layer ### Output ``` Output { amount uint time uint owner pubkey } ``` Identified by `(tx_hash, index)` where `tx_hash` is the hash of the transaction that created it. Spent outputs are removed from the set. ### Value A UTXO's spendable value at time T: ``` spendable(T) = amount × decay^(T − time) / SCALE − rent_owed(T) ``` ### Rent Each UTXO pays `rent` = 1000 base units per second for its place in the trie. Rent and demurrage are coupled — each unit of rent accrues demurrage from the moment it is deducted. The accumulated rent owed at time T: ``` rent_owed(T) = rent × (SCALE − decay^(T − time)) / (SCALE − decay) ``` Whenever a UTXO is consumed — whether spent in a transaction or pruned at expiry — the validator collects `rent_owed`. ### Expiry A UTXO expires when `spendable(T) ≤ 0`. Any node can verify this from the UTXO's own fields and the block time. ### Trie Each internal trie node stores one aggregate: `sum` — the sum of normalized amounts in the subtree. At insertion, each UTXO's `amount` is normalized to `norm_time` and added to `sum`. Both the UTXO trie and the people tree normalize values to a shared reference time `norm_time`. `norm_time` advances on multiples of 4 × YEAR from Unix time 0 (1970-01-01). Advancement need not be frequent — uint128 allows over 100 years between advances at planetary scale. When `norm_time` advances by Δ: `sum ×= decay^Δ`. ### Supply Total value at time T (including uncollected rent): ``` total(T) = sum × decay^(T − norm_time) ``` Convergence, verifiable from the two roots: ``` total(T) + unclaimed_ubi(T) → population × TOKEN ``` Rent does not destroy value — it relocates it from the UTXO owner to the validator upon collection. The convergence holds regardless of how much rent is uncollected. ### Pruning A validator may include a pruning transaction for any UTXO where `spendable(T) ≤ 0`. The validator collects the remaining value and the UTXO is removed from the trie. Validators are economically incentivized to find and prune expired UTXOs — how they track them is an implementation concern. ### Transfer ``` Transfer { inputs []Outpoint outputs []Output sigs []sig — one per input } Outpoint { tx hash index uint } ``` Spends UTXOs and creates new ones. Each input is signed by its owner — different owners can participate in the same transaction. Validation: each input exists and is unspent. Sum of output amounts ≤ sum of input spendable values at block time. Difference is the transaction fee. The validator also collects `rent_owed` on each input. Processing: remove spent inputs from the UTXO set. Create new outputs with `time` = block time. ### UBIClaim ``` UBIClaim { key pubkey amount uint nonce uint sig sig } ``` Mints UBI. `key` must exist in the tree with contribution > 0. `amount` ≤ `claimable(T)` at block time; the difference becomes a fee. Creates a single output owned by `key`. Nonce matches the node's nonce. Signed by `key`. Processing: create one output with `time` = block time. Update `last_ubi` to block time. Increment nonce. --- ## Consensus ### Block Production Blocks are produced at fixed time intervals — one slot per interval. `seq` starts at 0 at genesis and increments by 1 per slot; skipped slots leave gaps. `time = genesis_time + seq × slot`. The slot interval divides evenly into the election period, ensuring boundaries always fall exactly on a slot. Each slot has one validator selected via the election trie. The selected candidate signs the header and reveals one layer of the hash onion committed in their vote entry: `rand = prev_rand XOR revealed`. Every layer was pre-committed before `rand` was known — uncontrollable and unpredictable. If the selected candidate is offline, the slot is skipped and `rand = prev_rand XOR H(seq)` — deterministic, no reveal needed. Fork choice: the chain with the fewest skipped slots relative to its length wins. Blocks before the previous election period boundary are final — no reorg is accepted past that point. The genesis header includes an `election_trie` with at least one committed vote. This is sufficient for the initial validator to produce blocks until the population votes for the next. ### Election Validator selection operates in fixed-length periods aligned to Unix time 0. Each period, vote tokens are claimed, mixed, and committed into `next_election`. At the end of the period, `next_election` becomes `election_trie` and a fresh `next_election` opens. One committed entry is selected each block — its candidate validates that block. ### Election Trie Each internal node carries the count of committed entries in its subtree. The root gives the total — the pool size for RNG selection. Committed entries count as 1, uncommitted as 0. An entry is either uncommitted or committed. Uncommitted: `{amount, owner, mixed}`. Mixable. `mixed` starts at 0 from a VoteClaim and increments with each mix. Committed: `{commit, owner?}`. Amount=1, locked. `commit` is the top of a hash onion: `H(candidate || H(candidate || ... H(candidate || seed)))`. Depth chosen by the voter — determines how many times the entry can be selected. The seed is shared with the candidate in advance. `owner` is optional — a ledger may use it to share transaction fees with voters. ### VoteClaim ``` VoteClaim { key pubkey nonce uint sig sig } ``` Mints vote tokens. `key` must exist in the tree with contribution > 0. Creates a single uncommitted entry in `next_election`: `{amount: contribution, owner: key, mixed: 0}`. Updates `last_vote` to block time. Increments nonce. Only allowed in the open phase. ### Vote Transaction Mixes and commits existing uncommitted entries. Inputs: existing uncommitted entries in `next_election`. One signature per input, by the entry's owner. Outputs: uncommitted `{amount, owner, mixed}` and/or committed `{commit, owner?}`. Committed outputs must have amount=1. Every output declares a `mixed` value between 1 and `max_mix` in the transaction; committed entries do not store it. Constraint: `sum(output mixed) ≥ sum(input mixed) + count(outputs)`. Constraint: sum of inputs = sum of outputs. Only allowed in the open phase. ### Activation Each period has two phases. In the first half, `next_election` is open — tokens can be claimed, mixed, and committed. At the midpoint, `next_election` locks. At the end of the period, `next_election` becomes the new `election_trie` and a fresh `next_election` opens. The lock-to-activation gap ensures no one can predict which position the RNG will select. ### Selection `rand mod total_committed` selects a position. The trie's cumulative sums enable traversal to the selected entry. The selected candidate reveals one onion layer in the header. Verification: `H(header.validator || revealed) == entry.commit`. The entry's commit is updated to the revealed value. `rand = prev_rand XOR revealed`. ### Header ``` Header { seq uint time uint people_tree hash utxo_trie hash election_trie hash next_election hash prev hash validator pubkey rand hash — prev_rand XOR revealed onion layer sig sig — signed by validator } ``` `people_tree` is the Merkle root of the node tree. `utxo_trie` is the root of the UTXO trie. `election_trie` is the active election trie. `seq` starts at 0; `time = genesis_time + seq × slot`. --- ## Civil Registration Compatibility The tree structure maps onto existing population registration infrastructure. A country, region, municipality, or village can be an org node with its citizens as children. The hierarchy does not prescribe a specific administrative structure — any nesting of individuals, groups, and organizations works. --- ## Primitives SHA-256, Ed25519. Amounts are unsigned 128-bit integers at scale 10^16. All signatures include an opcode. | Constant | Value | Description | |---|---|---| | TOKEN | 10^16 | Base units per token | | SCALE | 10^16 | Fixed-point scale | | YEAR | 31557600 | Julian year in seconds | | decay | 9999999929290076 | Largest integer where power(decay, YEAR) < 0.8 × SCALE | | rent | 1000 | Base units per second per UTXO | | max_mix | 10 | Maximum mixing depth for uncommitted vote entries | | slot | 60 | Block interval in seconds | | period | YEAR | Election period length | All periodic operations — election periods, `norm_time` advancement — use intervals that are multiples or divisors of YEAR (e.g. YEAR/12 for monthly periods), aligned to Unix time 0 (1970-01-01). Genesis time must sit on the slot grid (divisible by `slot`). Multiples of 4 × YEAR from Unix time 0 land on 1974, 1978, ..., 2026, providing clean starting boundaries.