Implementing Token Staking in Mobile Crypto Wallet
Staking in a mobile wallet is one of the most responsible scenarios. Users lock assets for a period, earn rewards, face unbonding periods. Implementation errors mean lost funds or inability to withdraw.
Liquid Staking vs Native Staking
Native staking (e.g., ETH via Beacon Chain or SOL via validators): tokens physically go to a staking contract or delegate to a validator. ETH native staking requires minimum 32 ETH; mobile wallets typically integrate liquid staking protocols (Lido, Rocket Pool, Jito).
Liquid staking via Lido: user deposits ETH → gets stETH, which rebases daily. Lido.sol contract (0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84):
// iOS — stake ETH via Lido
let lidoContract = EthereumContract(json: lidoABI, at: lidoAddress)
let submitFunction = lidoContract.method(
"submit",
parameters: [referralAddress as AnyObject],
transactionOptions: .init()
)
// value = amount of ETH to stake
For Solana: Marinade Finance or Jito. Jito SDK (jito-ts) provides stake(validatorIndex, amount) instruction.
Native Solana Staking: Delegation
// Android — delegate SOL to validator via SolanaKT
val stakeAccount = Keypair.generate()
val createStakeAccountInstruction = SystemProgram.createAccount(
fromPublicKey = walletPublicKey,
newAccountPublicKey = stakeAccount.publicKey,
lamports = amountLamports + rentExemptLamports,
space = StakeProgram.STAKE_ACCOUNT_SIZE,
programId = StakeProgram.PROGRAM_ID
)
val delegateInstruction = StakeProgram.delegate(
stakePublicKey = stakeAccount.publicKey,
authorizedPublicKey = walletPublicKey,
votePublicKey = validatorVoteAccount
)
Solana epoch ≈ 2–3 days. Stake activates next epoch. Unstake also takes one epoch cooldown, then withdraw.
UI: Validator Selection and Rewards Display
Load validator list from external source:
- Ethereum:
beaconcha.inAPI for native,stake.lido.fi/apifor Lido stats - Solana:
validators.appAPI ormainnet-beta.solana.comRPCgetVoteAccounts
Display in a table: validator name, APY, commission (%), uptime over 30 days, delegator count.
Rewards: for Lido stETH, rebasing happens automatically, balance increases without transactions. For native: getInflationReward on Solana, eth_call to Rocket Pool contract for rETH exchange rate.
Unbonding and Unlock
Show unbonding period before the user taps "Unstake." Cosmos-based chains: 21 days. ETH native: instant (post-Shapella). Solana: ~5 days (2 epochs). Users unaware of lock will leave negative reviews.
"Pending Unlock" section with timer and amount—mandatory for networks with cooldown.
Timeline: 5 days for one protocol (e.g., Lido or Jito): contract integration, amount selection UI, confirmation screen with unbonding period, active stake and reward display, unstake button. Multiple protocols and networks: 2–3 weeks.







