Liking cljdoc? Tell your friends :D

Economics

Liquid storage collateral

Skuld reserves spending capacity while an account has live application data. For a finalized account, spendable = liquid balance − stored bytes × storage rate. Bonded and unbonding tokens contribute zero. A slash can reduce stake without changing the amount available to support existing data.

For example, start with 1,000 liquid units and 300 reserved for storage. A write with a fee of 20 that requires 50 more collateral leaves 980 liquid, 350 reserved, and 630 spendable. Delegating 500 leaves 130 spendable. Deleting the data releases 50 of spending capacity, less the deletion fee. No payment or token issuance accompanies the release.

A block checks cumulative usage against the candidate balance after fees. A refusal whose fee would consume reserved collateral leaves the nonce and balance intact. A delegation checks spendable balance after the block's transactions. Bytes are a deterministic accounting unit. The schedule counts binary payload length, UTF-8 for text and a fixed per-fact overhead. Physical disk use also depends on indexing, historical retention and node maintenance.

Ledger dataCollateral payer
Attribute in an account namespaceThe account owning the attribute, on any row
Shared application attribute on an owned rowThe row owner
Installed guard and its revisionsThe account owning the guarded attribute
Trusted application facts in invariant.*The signer of the transaction that created the fact
Internal block, account and consensus bookkeepingProtocol overhead

Genesis initializes the counters. The counter is persisted with each successful settlement. Operators can compare it with a full scan using skuld.ledger.storage/recompute. An ownership change can move existing shared data between payers, so its accounting scan is bounded.

Transferring a shared row

Alice offers an ordinary write transferring a row to Bob. Bob signs the same chain, Alice's nonce, transaction forms, fuel and recipient limits. The maximum is expressed in liquid token units and applies to the net increase in Bob's required collateral for that write. Alice pays the fee. Bob keeps his ordinary transaction nonce. Up to eight recipients can sign one offer.

(def offer
  (client/offer-transfer alice chain nonce
                         [[:db/add row :urd/owner bob-account-eid]]
                         0 {(:ns bob) 100000}))
(def signed (client/accept-transfer bob offer))

Submit the fully signed envelope. A missing or invalid declared acceptance leaves Alice's nonce and balance intact. A unilateral ownership change with no declared recipient is an authenticated refusal. Validators check actual storage effects and each recipient's available liquid balance. Removing the owner while leaving shared data behind is refused.

Public-network decisions

Liquid-only collateral is the selected storage rule. The remaining launch choices need an explicit genesis policy.

DecisionOptions and consequenceEvidence needed
Validator fundingFees alone require sufficient demand. A time-limited prefunded treasury has a runway equal to its subsidy budget divided by its net payout per period. Issuance funds validators by diluting holders.Cost per validator, expected fees at low use, bootstrap budget and its expiry
Fee allocationFees can fund participating validators and a community pool. Burning a share reduces what is available to pay operators.Block cost at steady and peak load, participation incentives and treasury mandate
Storage pricingA fixed collateral rate is predictable. A rate increase can leave existing accounts underfunded.Measured live bytes, history and replication costs, notice and an explicit policy for existing data
Misbehavior and exitMissing votes can forfeit rewards. Conflicting signed votes can justify slashing. Stake must remain exposed while admissible evidence can arrive.Verified historical committees, evidence deduplication, unbonding and correlated outages
Genesis and governanceAn initially identified committee makes the trust assumption inspectable. Delegated voting power changes who can finalize and who can block progress.Initial allocations, validator independence, concentration, upgrade and emergency authority

For a Tendermint deployment, test the distribution of voting power as well as the number of validator machines. A common operator or hosting failure can remove several nominally independent validators together. Distinguish the verified quorum that finalizes a particular block from evidence that an operator signed conflicting votes. Stake and rewards should follow evidence verified against the committee in effect at that height.

For a public beta, test units let operators exercise the complete flows and measure costs. The sample storage rate, slashing fractions, commission and community share are parameters for testing. Genesis allocations, the validator security budget and authority to change those parameters are separate decisions.

The fee schedule

base              1000
datom added        100
datom retracted    100
byte                 1

A retraction costs the same as an addition, and that is a change from an earlier schedule that discounted it. The discount gave a measured 2.13× advantage to churning data over adding it; parity brings that to 1.07×.

A deferred refund on deletion is a reasonable idea and is not this — that is a deposit, not a discount, and deposits are a different mechanism with different failure modes.

Pricing is measured on the transaction's produced datoms, not estimated from its text. [[:db/retractEntity 42]] is 23 characters and produced four datoms.

The accounting datoms — the fee and the nonce bump — are not themselves priced. Charging for the charge is circular: the fee would change the datoms that carry it. The consequence is that an applied transaction contains a few more datoms than were paid for, which is a constant per transaction and not a lever anyone can pull.

Fee settlement

The sender pays the fee once. The transaction entity records it as :urd/fee. At the next block the ledger seeks past its saved fee cursor and allocates fees and any issuance according to the previous commit. An absent validator's share and integer rounding dust go to the community pool. Rewards allocated to a validator's accounting balance and rewards withdrawn into a user's liquid account are distinct stages. The signed :withdraw-rewards and :withdraw-commission intents settle earned amounts into the eligible account.

Checking the supply

Pass a finalized database and the independently published genesis supply to skuld.block/reconcile-supply. Its difference should be zero. It counts liquid balances, validator stake, pending unbondings, outstanding rewards, the community pool and fees awaiting allocation. Collateral is already part of liquid balances. Commission is already part of outstanding rewards. The expected total is opening supply plus recorded issuance. Activating a burn policy would also require recording and reconciling burned tokens.

The community pool

Fed from three places: the community tax (2% by default), an absent validator's forfeited share, and truncation dust.

Rounding is always down. A fraction too much is a solvency hole; a fraction too little is dust, and dust has somewhere to go.

Issuance

Default is {:mode :none} — fee-only, which is the right starting point for a consortium launch.

It is data, not a function. A closure could not be serialised into the app-hash or replayed, and a chain whose issuance schedule cannot be replayed cannot be audited. :fixed and :decaying (Sui's shape) are the other modes.

Issuance and fees are one stream: both land in the same allocation step, so a validator's income has one code path rather than two that must agree.

The gas prototype

src-gas/ prices datahike queries by their planned work. It is on its own alias and its own datahike branch, deliberately off the default paths, and it already documents three things that break determinism: the query result cache, a plan cache keyed without a data component, and plan estimates that are deterministic but not upper bounds.

See also

Transactions for what each refusal costs · Staking for rewards and the community pool · Conservation for the checks that catch drift

Can you improve this documentation?Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close