Inflation Mechanism
Overview
The x/brahma module distributes inflation rewards to AI creators, Application operators, and contributors every block. Rather than minting tokens directly, it siphons a percentage of newly minted tokens from the BitSDK distribution module. The siphon percentage is controlled by governance.
Key Mechanism: x/brahma intercepts inflation from standard validator rewards, ensuring compatibility with existing staking mechanisms while enabling AI-specific distribution.
System Architecture
Process Flow (BeginBlock)
Every block, the x/brahma module executes the following steps (as visualized in the diagram above):
Siphon Tokens → Query distribution module balance, transfer
siphonPercentage= 50% to x/brahma module. The remaining 50% stays in the distribution module and flows through standard BitSDK staking reward mechanisms (community tax, validator commission, delegator rewards). Note: This ratio is governance-adjustable. Why this distribution ratio?Query Market Caps → For first 500 AIs, query ERC1155 contract for total gem supply (30-90 day rolling average window)
Calculate Proportions → Each AI's share =
aiMarketCap / totalMarketCap(e.g., AI #1: 75%, AI #2: 25% in the diagram)Distribute Per AI → Split rewards three ways (Creator 50%, Application 30%, contributors 20%)
Allocate to Contributors → Query historical tensor data, distribute proportionally by cores contributed (e.g., Contrib A: 50%, Contrib B: 30%, Contrib C: 20% of their AI's contributor portion)
Accumulate → Add amounts to claimable balances (users claim separately via
claimRewardstransaction)
Distribution Algorithm
Step 1: Siphon Tokens from Distribution Module
Step 2: Query Market Caps and Calculate Proportions
Step 3: Distribute Per AI
Step 4: Distribute to Contributors
Example:
Module Parameters
siphon_percentage
0.5 (50%)
% of distribution module balance siphoned each block
application_split
0.3 (30%)
Application operator's share
creator_split
0.5 (50%)
Creator's share of AI rewards
contributor_split
0.2 (20%)
Contributors' share
max_ais_for_rewards
500
Max AIs eligible (insertion order)
max_ai_block_heights
1,000
Historical blocks to process per AI
max_tensor_rows_per_block
1,000
Max contributor rows per block
Validation:
Splits must sum to 1.0 (100%)
All values between 0 and 1 (except max parameters)
Processing limits capped at 10,000 to prevent DoS
Key Data Structures
MarketCapHistory
Stores 30-90 day rolling average of AI market cap (gem supply from ERC1155):
Purpose: Smooths market cap volatility, prevents consensus issues from non-deterministic calculations.
ClaimableReward
Accumulated rewards per address:
Purpose: Two-step process (allocate → claim) prevents distribution failures from blocking inflation distribution.
Security & Safety
Bounded Processing
Max 500 AIs per distribution (first 500 by insertion order)
Max 1,000 blocks of tensor history per AI
Max 1,000 rows per block processed
Prevents unbounded loops that could halt blockchain
Overflow Protection
Uses
sdk.Decandsdk.Inttypes with safe mathValidates all tensor data before counting contributions
Prevents arithmetic overflow in reward calculations
Deterministic Consensus
30-90 day rolling average stored in KVStore (not memory)
Market cap stored as strings to preserve decimal precision
Circular buffer prevents unbounded storage growth
All calculations deterministic across validators
Two-Step Distribution
Allocate rewards to claimable balances (automatic)
Claim rewards via transaction (user-initiated)
Distribution never fails due to transfer errors
Users control timing and gas costs
Validation
Application authorization enforced (only registered Application can submit tensors)
AI tensors validated before tallying contributions
Address format validation (ERC20 hex format)
Core grant expiry system prevents stale permissions
Example Distribution
Setup:
Distribution module balance: 1,000 bplcoin
Siphon percentage: 50%
2 AIs with equal market cap (50% each)
Flow:
Key Design Decisions
Siphoning vs. Direct Minting
x/brahma doesn't mint tokens—it intercepts inflation from the standard BitSDK distribution module. This preserves compatibility with standard staking reward mechanisms. The remaining 50% continues through the distribution module's standard allocation: community tax (~5%) to the community pool, then staking rewards (~95%) split between validators (who earn commission) and delegators (who earn the majority proportional to stake).
Market Cap Metric
Current (Pre-AMM): gem_supply = ERC1155 totalSupply (queried from EVM precompile). This directly reflects user demand and engagement.
Future (Post-AMM): rolling_average[ (W1 × gem_supply) + (W2 × gem_market_cap) ] where gem_market_cap = AMM_price × supply. W1 and W2 are governance-adjustable weights that allow tuning the balance between supply-based and price-based metrics, mitigating price manipulation attacks on thin liquidity.
Insertion Order, Not Market Cap Rank
The first 500 AIs created receive rewards, preventing spam attacks where malicious actors create thousands of AIs to dilute rewards.
Rolling 30-90 Day Average
Smooths market cap volatility over a 30-90 day window to prevent reward manipulation via short-term gem supply spikes.
Two-Step Distribution
Separating allocation (automatic) from claiming (user-initiated) prevents distribution failures and gives users control over gas costs.
Historical Tensor Processing
Contributors earn rewards based on all past contributions (up to 1,000 blocks), not just recent ones. This recognizes long-term value creation.
Summary
x/brahma creates sustainable economic incentives by:
Siphoning 50% of inflation from distribution module, and it can be adjusted by governance.
Allocating proportionally by AI market cap metric (currently gem supply; future: weighted combination of supply and AMM price)
Splitting three ways: Creator (50%), Application (30%), contributors (20%)
Distributing to contributors by historical contribution cores
Accumulating in claimable balances for user-controlled claiming
This aligns incentives across all participants: creators, operators, and contributors all benefit from AI success, measured objectively by user engagement (gem holdings and market valuation).
Last updated