Expand description
§spacedb-meter — SpaceDB Layer 6 (metering & settlement)
SpaceDB measures; it does not price or pay. This crate computes the three
resource amounts deterministically — storage (Usage::storage, bytes × time ×
replica_count), compute (Usage::compute, fuel + invocations), and transit
(Usage::transit, bilaterally-corroborated served bytes) — accumulates them
in a MeterLedger, and drains them into amounts-only UsageClaims.
Pricing (RateCard), the agent spend cap (Budget), and pre-deploy cost
estimates are open-core too. Settlement is the seam: the bundled
LocalSettlement is enough for a self-hoster, while a host implements
Settlement over its own money plane — for MATA that is the existing
UsageClaim → Maestro counter-sign → EarningRecord → Iron Bank loop — so
SpaceDB usage settles through it without ever depending on it.
Open-core (MIT). No spacedb-* / mata-* dependencies.
Structs§
- Budget
- A remaining spend allowance, in micro-
$MATA. - Local
Settlement - The bundled, marketplace-free settlement: price against a rate card and tally
per customer. No
$MATAis minted — that is a host’s concern. - Meter
Ledger - Accumulates usage per customer mID until drained into claims.
- Proof
Ref - A content-addressed link to the artifact that backs a claim — e.g. a
FunctionRundigest (M6) or a proof-of-storage probe response. - Rate
Card - Prices per resource unit, in micro-
$MATA. - Settled
- A priced settlement receipt (the open-core analogue of an
EarningRecord). - Totals
- Accumulated amounts for one customer.
- Usage
Claim - A unit of metered work, ready for settlement. Amounts only.
Enums§
- Meter
Error - Proof
Kind - What kind of proof backs a claim (mirrors maestro’s
ProofKind). - Resource
- The class of a resource — the settlement bucket.
- Usage
- A measured amount of one resource class over a period.
Traits§
- Settlement
- Consumes usage claims and settles them. A host plugs its money plane in here.