Staking Module Development for Chains, Protocols and Apps
Protofire builds staking contracts for chains and protocols, and staking flows inside apps. Both record each position from stake through unbonding to withdrawal, and the client's Safe holds each admin key. We built KyberDAO's pool-master proxy contract in 2020 and a Safenet staking interface in 2026.

Reviewed by Diego Torres, Offer Owner at ProtofireLast reviewed: November 2026
On this page
Work shipped for 60+ networks and 95+ protocols, including
Two staking failures that look like small bugs
Staking module development deals with two failures that look like small bugs. One is a record that is ahead of the chain, and the other is a contract role that nobody renounced. For example, a staker asks to leave and your app already says "withdrawable", but the chain says the tokens are still bonded.
On a Cosmos SDK chain, a delegator who unbonds can still be slashed for the whole UnbondingTime, for offenses committed while bonded (Cosmos SDK). Solana rejects a new delegation while stake is still cooling down (Anza). A dashboard that marks such a position withdrawable overstates what will arrive, and so does the firm's ledger behind the dashboard.
A second failure is in the contract roles. In OpenZeppelin Contracts 5.x, a TimelockController administers itself, plus an optional admin named at deployment (TimelockController.sol). Until that admin renounces its role, the admin can grant and revoke roles without the delay. Stakers who joined under one fee or lock rule are then exposed to whoever holds that key.
This delay protects the users of the smart contract by giving them time to review the maintenance operation and exit the system if they consider it is in their best interest to do so.
Who owns each layer of a staking build
Stakers sign their own stakes and withdrawals. Your Safe holds the contract roles. The network decides bonding, unbonding and penalties. Where an app stakes through a provider, the provider runs the validators.
Stakers' wallets or the firm's custody
Contract roles
Staking and delegation contracts
Staking flow, indexer and position records
Validators, provider API and staking protocol
Our staking record: KyberDAO in 2020 and Safenet in 2026
Kyber Network named Protofire for staking work in 2020, and the Safe Foundation named Protofire for staking work in 2026.
The KyberDAO pool-master proxy contract, built in 2020
Protofire built the pool-master proxy contract for KyberDAO staking in 2020, during KyberDAO's launch preparations (case study). Kyber Network's post of 28 May 2020 thanked Protofire for "professional support" on a "trustless smart contract proxy" for non-custodial KNC staking and voting delegation. KNC holders delegated their voting power to a pool operator's contract. The operator voted for the holders and, in the repository's words, had "no control over their KNC or ETH rewards". The code is public on GitHub, with the MIT license and a v1.0.0 audit report. Stake Capital later built staking products on that code. Kyber's ecosystem report of June 2020 described the proxy contracts Protofire built for KyberDAO pool operators.
The Safenet staking interface, built in 2026
In its Q3 2026 report, the Safe Ecosystem Foundation lists Protofire among the teams it signed grant agreements with to build independent Safenet staking interfaces. Protofire built an alternative interface for staking SAFE on Safenet, and that grant supported the development (GitHub). The interface reuses staking, rewards and withdrawal logic from the Foundation's open-source interface, and it calls the same contracts. The repository calls the interface an independent project and not an official Safe product. The interface's code is public. From the KyberDAO and Safenet builds, Protofire applies the role design, the claim records and the staker-facing interface to new staking work.
What you get from staking module development
A chain or protocol gets the staking contracts.An app on a network's own staking gets the flow, the position records and the interface.
Staking contracts and a screen your auditor can follow
Your stakers get a screen built on recorded amounts and states. Protofire builds stake, delegate, redelegate and unstake functions for your token, operator or pool contracts. We also write tests for each path your terms name, including a stake after a slash and an unstake during a pause.
Position records that match the chain
Your dashboard stops promising a withdrawal the chain has not released. A position reads pending, active, unbonding, withdrawable, withdrawn or slashed, and it moves to a new state on a finalized chain or contract event. Protofire builds the unbonding queue and an indexer keyed by UnbondingID, stake account or validator index. The indexer keeps one record per request, from the request to the withdrawal.
Checks that catch a retry or a mismatched address
A timeout, a retry or a wallet's speed-up does not create a second position. Protofire's flow reads the signer's nonce or the stake account on chain before it prepares anything new. The flow also lists each hash tied to a position. On Ethereum, the flow decodes the deposit data a provider returns. It checks that the credentials in that data name the address the staker chose. The flow makes this check because the first deposit for a validator key fixes the credentials (consensus specs).
Slashing penalties recorded per position
When a slash occurs, each affected position, active or unbonding, shows a slashed state with the amount and the event behind it. Protofire builds the indexer to read the slash event a Cosmos SDK chain emits. On Ethereum, the indexer reads the status and balance a beacon node reports (Beacon API). Where your rules define a contract penalty, the indexer reads your contract's own penalty event.
Reward ledgers that trace each amount to an event
Each staker sees accrued, claimable and claimed amounts, and each amount traces to an event. Protofire builds one of three reward ledgers, chosen with you. The first is a per-share index with direct claims. The second is a Merkle root posted each period, with a proof per staker. The third is a pool share whose redemption value moves. Your key funds the rewards or posts the root. For the Merkle ledger, Protofire builds the service that computes each period's root, and your staff deploy that service in your environment.
Parameter changes that give stakers notice
A fee or lock change reaches stakers with notice, and a pending value shows before the change takes effect. Minimum stake, lock or unbonding length, fee and pause each have a named holder, behind your Safe or a timelock. Protofire writes the parameter register and sets each delay against the unbonding period. We also flag each upgrade or pause path that skips the delay.
How a staking module build with Protofire runs
The work starts from your staking rules and ends with a deployment your Safe controls.You send the chain, the token, your unbonding, penalty and fee rules, and the Safe that will hold the contract roles.
- Step 1
A role table in the first proposal
The first proposal names the holder of each contract role and each timelock role. It also sets each parameter delay against the unbonding period. Where you want a delay, a TimelockController owns the contracts. Protofire creates the TimelockController with no optional admin, so it administers itself. Its proposer and canceller roles go to your Safe. - Step 2
Contracts, indexer and flow tested against the chain
Protofire writes the contracts, the indexer and the flow, with tests for each path your terms name. Each position record is checked against the chain's own entries. - Step 3
An audit firm you choose reviews the code
You choose the audit firm. Protofire hands the firm the test suite and the parameter register, and we fix what the firm finds. An audit lowers risk, but it does not promise code free of bugs. - Step 4
Deployment from your key
The deployment runs from your key. Your Safe holds each admin, upgrade and parameter role from the deploy transaction on. The key that funds the reward pool or posts a reward root is also yours, and a service you own uses that key. - Step 5
The roles and keys you hold after launch
After launch, Protofire holds no admin, upgrade, parameter, pause or reward role. In app staking, the staker or the firm's custody holds the Ethereum withdrawal address. The same holder keeps the Solana stake and withdraw authorities and a Cosmos SDK delegator's account. Whoever runs the signer holds the validator signing keys. The signer may be run by the firm, by its provider, or by Protofire where a validator operations scope puts the signer on our machines.
How work with Protofire starts
Protofire's shared terms apply to a staking build, and how we work gives the detail.
- Proposal
- In writing, one business day after the discovery call: findings, a plan in phases and the first step we recommend.
- Price
- Fixed per phase when you commission it, against written acceptance criteria. Overruns inside them are ours to absorb, invoices follow delivered milestones, and you can stop at any phase boundary. Anything we operate after launch is priced in the proposal as its own recurring line, with the notice to end it.
- Ownership
- Code we write for you, contracts, the keys and credentials this work creates and the accounts your infrastructure runs in are yours by contract, within the license of any third-party software involved. Keys that a custody platform or a staking provider holds under its own key model stay with it under your contract; every other custody key stays with you or the custodian you appoint. Where the scope places something on servers we rent, it says what moves to you and when. An NDA is available from your first message, and we sign a data processing agreement (DPA) together with it.
- After launch
- Delivery closes with a hypercare window and a defect warranty, with their terms written into the proposal. A service we operate continues under its written scope until that scope ends.
- Access
- Read-only by default. A role that can start requests only if your written scope names one; never a signer, approver, administrator, key holder or recovery role on your contracts, wallets or custody platform. Services we build call each platform on credentials your staff issue and keep in your vault. Anything that approves or moves funds runs in your environment, and a scope under which we operate a service lists every write call it makes. Where the scope has us operate nodes, validators, monitors, explorers or indexers, it names the role and any key we hold on those servers, and in your own cloud account you can remove it.
- Licenses
- Protofire is an engineering firm and holds no financial or crypto-asset license; licensed activity stays with you and your providers.
How we work shows a worked proposal.
When a staking module build does not fit
A staking module build records stakes held in your own contracts or app.Receipt tokens, vote locks, a single provider connection and a chain whose stock modules already fit each need a different build.
- A tradable token issued against staked assets is liquid staking, with its receipt token. Locking tokens for vote weight that decays over time is vote-escrow staking.
- An app that needs one provider connection starts on that provider's page. For Kiln, Protofire builds a check of each unsigned transaction before custody signs. For Figment, we build a statement tie-out for omnibus batches. For Blockdaemon, we build a reward ledger by epoch.
- A Cosmos SDK chain whose stock x/staking and x/slashing modules match its rules needs no new contracts. Parameters such as UnbondingTime and SlashFractionDowntime are chosen through the chain's governance. Contracts start where the token stakes for something those modules leave out, such as a fee share.
- A bank or broker adding staking to custody it runs today starts from the staking blueprint, which includes the regulatory material.
Open source we’ve shipped
The Protofire repositories behind this page.
FAQ
What is staking module development?
Who can build staking contracts for a protocol, or a staking flow for a wallet or fintech app?
What happens to an unbonding position when its validator is slashed, and who bears the loss?
Can a lock period or fee change reach stakers who are already in?
Who signs a user's stake and withdrawal in an app?
Who audits the staking contracts?
Do you also run the validators?
Get a proposal
Tell us what you are building. An engineer reads it, we have a short call, and the written proposal follows within one business day.
