heimdall-stake: stake function and splitting-gain report (Rust, zero deps) #9
Loading…
Reference in a new issue
No description provided.
Delete branch "libby/heimdall-stake"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
New package
packages/heimdall-stake, besideheimdall-delegation.weight = 1 + log_b(amount/unit)per Meta, in integer cents and integer micro-weights (1,000,000 = 1.0) with an integer-only logarithm (deterministic across platforms), plus Heimdall's floor, per-identity cap and minimum amount per identity, and a splitting-gain report (splitting_gain,splitting_curve,most_profitable_split). README: first call, formula with Meta's example (100 EUR is 3, 10,000 EUR is 5, both tested exactly), prior art (quadratic voting, Lalley-Weyl, Sybil; cited from background, marked as not re-fetched), and the note that the estate rule normalizes above and the sybil rate is a harness adversary. All parameters are placeholders until the estates rule.Tests: 11 property/behaviour tests pass (
cargo testin the package; 0 unit tests, 0 doctests): Meta's example, exact powers for other bases and units, integer log vs f64 within 2 micro-weights over 20,000 draws, monotone, concave above the unit, zero at and below the floor, cap never exceeded and binds, deterministic and total over i64::MIN..MAX, bad parameters are errors, the split report equals a hand sum, and the minimum makes splitting stop paying.Choices to confirm: floor is exclusive (an amount at or below it weighs 0; the brief said both "below" and "at/below");
per_identity_capcaps weight, not amount; floor and minimum both zero a weight and may want to be one parameter; base is an integer of at least 2.A finding worth Heimdall's eyes: the log formula's +1 rewards splitting (100 EUR as ten identities of 10 EUR weighs 20 against 3), and the minimum prices it as a cliff, not a slope. With a 50 EUR minimum, 100 EUR in two identities still gains (5.40 vs 3.00); in three it weighs 0. The minimum has to sit near a typical budget to deter splitting.
Not merged.
🤖 Generated with Claude Code
Maintainer sanity run at head
9adee904:cargo test --offlinein packages/heimdall-stake, 11 pass, 0 fail (0 unit, 0 doc). Forge CI: 6 pending, 3 skipped (workflows waiting for a runner; none has ever started on this repo). Not merged, Heimdall to review.6f68341edd84f932ec50