Concept
The x/servicepool module replaces the former inflationary x/mint module. DChain runs with zero inflation and a
fixed total supply: the module never mints. Staking-style rewards and service payments are funded from a pre-funded
pool (seeded at genesis) plus a share of protocol fees, rather than from newly minted supply.
Mainnet configuration: on
dchain-1the fee split is currently set to burn 100% of accrued fees (fee_burn_ratio = 1,fee_distribute_ratio = 0, daily epoch), so no fees are distributed as staking rewards and none are retained; validator rewards (a fixed 15,000 DT per bonded validator per epoch) are funded from the genesis-seeded pool balance. All of these values are governance-settable and may change.
What the pool does
- Validator rewards — a fixed, stake-independent reward paid to each bonded validator once per epoch, drawn from
the pool's available balance. Jailed validators receive nothing: the round pays the validators returned by
x/staking's bonded-by-power query, and jailing removes a validator from the power index behind that query immediately — even before its status flips to unbonding at the end of the block. A jailed validator rejoins the reward round only after it is unjailed and bonded again. - Staking rewards from fees — a governance-controlled share of accrued protocol fees is routed to the fee collector
each epoch and paid out as ordinary staking rewards by
x/distribution(reaching both validators and delegators, weighted by stake, net of commission and community tax). - Governance-directed service payments — an authority-gated
MsgFundFromPoollets governance batch-send tokens from the pool's available balance to any recipients.
Balance model
The module account physically holds one balance, logically split into two pots:
- Available (settled) balance =
moduleBalance − AccruedFees. Seeded by the genesis allocation and topped up each epoch by the fee retain slice. Funds validator rewards and governance payouts. - Accrued fees = the
AccruedFeescounter: protocol fees received since the last epoch tick, earmarked for the three-way split at the next epoch. A transient per-epoch buffer, zeroed each epoch — never a lifelong accumulator.
Invariant: AccruedFees ≤ moduleBalance at all times. Every fee intake raises balance and counter by the same
amount atomically; the epoch split removes exactly the burned+distributed amount and zeroes the counter; all other
outflows are guarded to never exceed moduleBalance − AccruedFees.
Fee inflows
Two sources feed the pool's per-epoch three-way split (burn / distribute / retain):
- Gas fees (EVM and Cosmos transactions) are swept from the
fee_collectorevery block by the module'sBeginBlockerand accrued into the pool. TheBeginBlockeris ordered first inbegin_blockersso gas fees are batched per epoch rather than paid out per block. See Block lifecycle. - Application fees (e.g.
x/notarynotarisation fees) are routed explicitly through the keeper'sCollectFeeentry point, which also handles optional third-party fee sponsorship viax/feegrant.
Both inflows commingle in one AccruedFees pot and share one split. Because the retain slice replenishes the available
balance, the pool is self-sustaining whenever retain share × fee inflow ≥ validator rewards + governance payouts;
governance tunes the ratios and the per-validator reward to manage runway.
Application-fee integration (CollectFee)
CollectFee is the single, module-agnostic entry point for application-level fees. A fee-charging module (currently
x/notary; reusable by any other) declares a narrow interface in its types/expected_keepers.go:
type ServicePoolKeeper interface {
CollectFee(ctx context.Context, sender, appFeeGranter sdk.AccAddress, fee sdk.Coin, msgs []sdk.Msg) error
}
CollectFee validates the fee denom, resolves the optional sponsor, moves the coins into the pool, and increments
AccruedFees — atomically, inside the caller's transaction. If any step fails the whole transaction reverts: no fee
without the operation, no operation with broken accounting.
- Single denom. Only
ServicePoolDenomfees are accepted.AccruedFeesis a denom-less counter interpreted through that param; accepting another denom would desynchronise the counter from the pool's actual coins. - Optional sponsorship. If
appFeeGranteris non-nil and distinct from the sender, the granter must hold anx/feegrantallowance to the sender coveringmsgs; the fee is then charged to the granter. Otherwise the sender pays.msgsis forwarded opaquely to feegrant (forAllowedMsgAllowancefiltering) — servicepool never inspects it, so it imports no fee-charging module. - Dependency direction is strictly one-way: notary → servicepool. servicepool depends on
bank/staking/account/epochs/feegrant only — no import cycle. The feegrant keeper reference is nil-safe: on a chain
without
x/feegrant, unsponsored fees work and sponsored ones error.
Community pool
servicepool does not fund the community pool directly. The community pool is funded through x/distribution's standard
communityTax skim on the epoch distribute slice. Since gas fees reach x/distribution only via that slice, there is
no separate per-block community-tax skim on raw gas fees.
Zero-inflation guarantee
The module account holds only the burner permission (never minter) — an account-level guarantee that supply can only
ever decrease (via the burn slice of the fee split), never increase. The module account is also in
bank.blocked_module_accounts_override, so external MsgSend donations cannot bypass the split accounting.
Genesis seeding
The pool is seeded at genesis via x/bank genesis (a balances entry for the deterministic module account address,
with matching supply) — not by minting. servicepool's own InitGenesis sets Params, AccruedFees (default 0), and
LastPaidTime (default zero, so the first due epoch after genesis pays a validator-reward round).