Protocol
Paymaster
HipPaymaster pays gas for HIP-ID accounts. A signer service approves each operation, and on-chain daily caps bound what that signer can ever spend.
The policy
HipPaymaster at 0x26aBbBEd6fb0E276d7DF51e7b8f8CEe3BB52c576 pays gas for HIP-ID accounts. These are the values set at deployment and the hard maxima compiled into the contract. The owner can change the values with setLimits, never above the maxima.
| Limit | Current | Hard maximum |
|---|---|---|
accountDailyWei, per account per UTC day | 0.003 HYPE | 0.01 HYPE |
globalDailyWei, all accounts together per UTC day | 0.02 HYPE | 0.5 HYPE |
sessionOpsPerDay, session-key ops per account per UTC day | 50 | 1,000 |
The account budget and the session-op count are multiplied by 1 + boost, where the boost comes from $ID staking. The global budget is never multiplied.
What validation checks
validatePaymasterUserOp runs, in order:
- The caller is the EntryPoint.
paymasterAndDatais exactly 129 bytes.- The sender is a HIP-ID account. With
initCode, its first 20 bytes must be the HIP-ID factory. Without it, the sender's codehash must equal the hash of the EIP-1167 clone runtime code pointing at the HIP-ID account implementation. This identifies every account the factory made with no registry. - The call is
executeorexecuteBatch, and no inner call targets the paymaster itself. Anything else reverts withCallNotSponsored. - The signer's approval: an EIP-191 signature over
getHash(userOp, validUntil, validAfter). A wrong signature is reported to the EntryPoint as a signature failure, not a revert. - The budgets: the full
maxCostis reserved against the account and the global budget, or the call reverts.
It returns validUntil and validAfter in validationData, so the EntryPoint enforces the approval window too.
paymasterAndData
paymaster 20 bytes
paymasterVerificationGasLimit 16 bytes
paymasterPostOpGasLimit 16 bytes
validUntil 6 bytes uint48
validAfter 6 bytes uint48
signature 65 bytes r ++ s ++ v
---------
129 bytes
getHash = keccak256(abi.encode(
sender, nonce, keccak256(initCode), keccak256(callData), accountGasLimits,
paymasterAndData[20:52], preVerificationGas, gasFees,
block.chainid, address(paymaster), validUntil, validAfter))The hash covers the paymaster's own gas limits but neither its own signature nor the account signature, so the account signs after the paymaster has approved.
Budgets and the UTC day
The day is block.timestamp / 86400, which rolls over at 00:00 UTC. On the first sponsored operation of a new day the account's counters and the global counter reset to zero.
- Account:
spentWei + maxCost <= accountDailyWei x (1 + boost), elseAccountBudgetExceeded. - Session ops: when
userOp.signature[0] == 0x01,sessionOps + 1 <= sessionOpsPerDay x (1 + boost), elseSessionOpsExceeded. - Global:
spentWei + maxCost <= globalDailyWei, elseGlobalBudgetExceeded.
Anyone can read the state: usageOf(account), budgetOf(account) and globalUsage().
Reserve, then refund
Validation cannot know the final gas, so it reserves the worst case, maxCost, as given by the EntryPoint. After execution postOp computes the charge and returns the rest:
charged = min(actualGasCost + 20,000 * actualUserOpFeePerGas, maxCost) // POSTOP_OVERHEAD_GAS
refund = maxCost - chargedThe 20,000 gas overhead covers postOp itself, which runs after actualGasCost is measured. If the UTC day rolled over between validation and postOp, the counters were already reset and there is nothing to refund.
The signer service
The bundler holds the paymaster signer key and signs an approval in pm_sponsorUserOperation. Before signing it refuses operations from an unknown factory and operations that would exceed the account's daily budget, which the chain would refuse anyway. Each approval is valid from 30 seconds before signing until 300 seconds after.
The signer can approve, or decline to approve. It cannot raise a cap, cannot sponsor a non-HIP-ID account and cannot redirect a sponsorship to a call on the paymaster. If the key were stolen, the most it could spend is the global daily budget per day, on gas only, until the owner rotates it with setSigner.
EntryPoint stake and deposit
The paymaster is staked in the EntryPoint with an unstake delay of 24 hours (1 day), as ERC-4337 expects from a paymaster that reads its own storage during validation. Gas is paid from the paymaster's EntryPoint deposit, which is the sponsor's own float. Anyone can top it up with deposit(). The owner can withdraw it with sweep; no user money is ever held there.
$ID stake boost
HipStake at 0x6b2C2F34c2fBf65251Da540670f9345655449275 raises an account's budget in exchange for staked $ID. Each full 10,000 $ID staked by the account adds one base budget, up to 9 extra budgets, so the account budget and its session-op count reach at most 10 times the base.
stake(amount)moves tokens in.requestUnstake(amount)removes them from the boost at once and starts a 24 hour delay.withdraw()returns them after the delay. A new request adds to the pending amount and restarts the delay.- No step needs the owner or a keeper. Stakers can always exit.
- The token address is set once by the owner and can never change after. It is not set yet, because $ID has not launched. Until then
stakereverts and every account's boost is 0.
Planned
Planned: letting the paymaster take its gas fee in tokens, and a buyback or burn funded by those fees. Neither exists in the deployed contract today. The paymaster sponsors in HYPE only and takes no fee.
Tests
| Test | Checks |
|---|---|
invariant_dailyCapsHold | Random sponsorships, settlements and day changes: no account is ever charged more than its daily budget, and all accounts together never more than the global cap |
test_sponsorsAndRefunds | maxCost reserved, then the exact charge kept after postOp |
test_accountBudget | Second op over budget refused; a new UTC day resets |
test_globalBudget | Third account refused once the global cap is reached |
test_sessionOpsPerDay | Session ops beyond the daily count refused |
test_stakeRaisesBudget | 30,000 $ID staked gives 4 times the budget; the boost drops the moment unstake is requested |
test_refusesCallToPaymaster | Direct and batched calls to the paymaster refused |
test_refusesForeignAccounts | An EOA and a foreign factory refused |
test_limitsBounded | setLimits above a maximum, or by anyone but the owner, reverts |
test_paymasterRefusesSelfCall | Elysium mainnet fork: a sponsored call to the paymaster fails in handleOps |
The invariant runs 64 sequences of depth 64 (foundry.toml).



