Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
LABS
Guides

Launching a LST with a Non-Custodial Staking Interface

A step-by-step developer tutorial for building a user-facing frontend to interact with a non-custodial Liquidity Staking Token protocol. This guide covers wallet connection, staking/unstaking flows, and displaying real-time data.
Chainscore © 2026
introduction
LIQUID STAKING

Introduction to Non-Custodial LST Frontends

Learn how to build a user-facing interface that allows stakers to mint liquid staking tokens (LSTs) without ever surrendering custody of their assets.

A non-custodial liquid staking token (LST) frontend is a web application that enables users to stake native assets (like ETH or SOL) and receive a liquid derivative token, all while retaining control of their private keys. Unlike custodial services, the staking operation is executed via a smart contract that the user approves, not by depositing funds into a third-party wallet. This model is fundamental to DeFi's self-custody ethos, reducing counterparty risk and aligning with protocols like Lido on Ethereum or Marinade on Solana, where the staking logic is on-chain and verifiable.

The core technical flow involves three parties: the user's wallet, the frontend dApp, and the staking smart contract. The frontend's primary job is to facilitate a secure transaction. It guides the user to sign a message approving a specific amount of their asset to be locked in the contract. The contract then mints an equivalent amount of LSTs and sends them back to the user's address. Critical frontend responsibilities include fetching real-time data (exchange rates, pool TVL, rewards APY) from the contract and oracles, and constructing the correct transaction calldata for the user to sign.

For developers, building this interface requires integrating with both a wallet provider (like MetaMask or Phantom) and the staking contract's ABI. A basic mint function interaction in a React component using ethers.js might look like this:

javascript
const contract = new ethers.Contract(stakingPoolAddress, stakingABI, signer);
const tx = await contract.deposit(ethers.utils.parseEther('1'));
await tx.wait();

This code snippet initiates a deposit, but a production frontend must also handle transaction status, error states, and post-transaction updates to the user's balance.

Security and user experience are paramount. The frontend must clearly communicate transaction details before signing, such as the exact amount being staked, the expected LST mint amount, and any fees. It should also integrate transaction simulation tools (like Tenderly or Solana's simulation) to preview outcomes. Furthermore, displaying the staking contract's audit status and verification links (e.g., Etherscan) builds essential trust in the non-custodial process, assuring users the code is doing only what they approve.

Ultimately, a successful non-custodial LST frontend abstracts away blockchain complexity while preserving user sovereignty. It turns a multi-step, technical on-chain operation into a simple click-flow: connect wallet, input amount, review contract interaction, and sign. By providing transparency, real-time data, and a seamless bridge to the underlying smart contracts, these frontends are the critical adoption layer that brings liquid staking to a mainstream audience.

prerequisites
LAUNCHING A LIQUID STAKING TOKEN

Prerequisites and Setup

This guide outlines the essential technical and operational requirements for launching a Liquid Staking Token (LST) with a non-custodial interface.

Before writing any code, you must establish the foundational requirements for your LST protocol. This includes defining the target blockchain network (e.g., Ethereum Mainnet, a specific L2 like Arbitrum, or a Cosmos SDK chain), the native token to be staked (e.g., ETH, ATOM, SOL), and the core staking mechanism. You will need a secure smart contract architecture to handle user deposits, delegation logic, and the minting/burning of the LST. A non-custodial design is paramount; user funds should never be held in a protocol-owned wallet but should be directly delegated to validators from a contract the user controls.

The development environment requires specific tooling. You will need Node.js (v18+ recommended) and a package manager like npm or yarn. Essential libraries include a smart contract development framework such as Hardhat or Foundry, along with the OpenZeppelin Contracts library for secure, audited base implementations like ERC-20 for your LST token. For testing, you'll need a local blockchain simulator like Hardhat Network or Anvil, and a wallet such as MetaMask for interaction. Familiarity with Solidity (or the native language of your target chain) and a basic understanding of Proof-of-Stake consensus are necessary prerequisites.

Key operational prerequisites involve validator selection and risk management. For a non-custodial model, you must integrate with your target chain's staking module. On Ethereum, this means interacting with the Beacon Chain deposit contract and potentially using a service like the Obol Network for Distributed Validator Technology (DVT). You must decide on a validator set strategy: will you run your own nodes, use a whitelist of professional operators, or implement a decentralized curator? Each choice carries different implications for decentralization, slashing risk, and operational overhead that must be documented and communicated to users.

wallet-integration
FOUNDATION

Step 1: Wallet Connection and Provider Setup

The first step in launching a Liquid Staking Token (LST) is establishing a secure connection between your application and the user's wallet, and configuring the Web3 provider to interact with the blockchain.

A non-custodial staking interface requires users to connect their own wallets, such as MetaMask, WalletConnect, or Coinbase Wallet. This is achieved using libraries like Ethers.js v6 or viem. The core action is requesting account access via the eth_requestAccounts JSON-RPC method. This process never gives your application control over the user's private keys; it only requests permission to read the account address and prompt the user to sign transactions. Always implement a clear disconnect function and handle network changes (e.g., a user switching from Ethereum Mainnet to a testnet) gracefully to maintain a good user experience.

Once connected, you must instantiate a provider and a signer. The provider (e.g., JsonRpcProvider, BrowserProvider) is a read-only connection to the blockchain network, used for querying data like balances and contract states. The signer, derived from the provider, holds the user's account and is authorized to send transactions and sign messages. For a staking interface, you will typically create a contract instance (for your staking pool or validator contract) connected to this signer: new Contract(contractAddress, abi, signer). This enables your app to call functions that require the user's authorization, such as deposit() or requestWithdrawal().

Security is paramount at this stage. Always verify the connected network. If your staking contracts are deployed on Ethereum Mainnet, your application should check provider.getNetwork() and alert the user if they are on an unsupported chain. Consider using the @web3-react library or Wagmi hooks for React applications, as they provide robust, framework-specific abstractions that handle connection state, chain switching, and caching out-of-the-box, reducing boilerplate and potential errors in your implementation.

For a production LST launch, supporting multiple wallet injection methods is crucial. While window.ethereum is common for browser extensions, you should also integrate WalletConnect v2 for mobile wallet support and Coinbase Wallet SDK. Use a library like Web3Modal or ConnectKit to present a unified connection modal that abstracts these different providers. This ensures maximum accessibility for your users regardless of their preferred wallet client.

Finally, after establishing the connection, your interface should immediately fetch and display key user-specific data. This includes the user's native token balance (e.g., ETH) for staking, their current LST balance, and their pending rewards. These queries are performed using the provider object and your staking contract's read-only functions. Setting up efficient, cached queries for this data forms the real-time foundation of your staking dashboard.

contract-interaction
IMPLEMENTATION

Step 2: Interacting with LST Smart Contracts

This guide details the core technical interactions for launching a Liquid Staking Token (LST) using a non-custodial staking interface, focusing on smart contract calls and user flow.

A non-custodial LST interface acts as a front-end wrapper for underlying smart contracts. The core interaction begins when a user connects their wallet (e.g., MetaMask) to the dApp. The interface reads the user's balance and the current state of the LST protocol—such as the exchange rate between the native asset (like ETH) and the LST (like stETH)—directly from the staking contract on-chain. This is done using view functions that require no gas, providing real-time data for the UI.

The primary user action is the stake transaction. When a user submits an amount to stake, the interface constructs a transaction that calls the submit or stake function on the main staking contract (e.g., Lido's Lido.sol). This function transfers the native tokens from the user's wallet to the contract and mints a corresponding amount of LSTs based on the current exchange rate. Crucially, the user never relinquishes custody of their keys; they simply sign a transaction that interacts with a public, audited smart contract.

For developers, key contract interactions include querying the getPooledEthByShares and getSharesByPooledEth functions to calculate mint/burn amounts, and listening for Transfer and Submitted events to update the UI post-transaction. Security best practices mandate that the interface should source all logic and rates from the on-chain contracts, not off-chain APIs, to prevent manipulation and ensure transparency.

The unstaking or withdrawal process varies by protocol. Some LSTs, like Lido's stETH, are rebasing tokens where the balance increases in-wallet. Others, like Rocket Pool's rETH, are non-rebasing and appreciate in value relative to ETH. With newer withdrawal-enabled protocols (e.g., Lido V2), the interface must also guide users through the request-and-claim flow, interacting with separate WithdrawalQueue or Claim contracts.

Integrating a non-custodial staking interface requires handling chain-specific details. On Ethereum Mainnet, you interact directly with the LST contract. For Layer 2s or alternative chains, you may need to bridge the LST or use a canonical representation. Always verify contract addresses from official sources like the project's GitHub or Etherscan, and use established libraries like ethers.js or viem to handle transaction signing and state reading.

transaction-flow
USER INTERFACE

Step 3: Designing the Staking and Unstaking Flow

This step focuses on building the frontend logic that allows users to interact with your Liquid Staking Token (LST) protocol, enabling secure and intuitive staking and unstaking operations.

The staking and unstaking interface is the primary user-facing component of your LST protocol. Its core functions are to deposit native tokens (e.g., ETH, SOL, MATIC) into the protocol's validator smart contracts and to withdraw the corresponding LST tokens or underlying assets. A well-designed flow must handle wallet connection, transaction signing, balance updates, and clear status feedback. For Ethereum-based LSTs, this typically involves interacting with a staking contract's stake() and unstake() or requestWithdrawal() functions, using libraries like ethers.js or viem.

Key considerations for the staking flow include handling approvals for ERC-20 tokens if applicable, calculating and displaying real-time exchange rates (e.g., how much stETH 1 ETH will mint), and managing transaction states (pending, confirmed, failed). The interface should fetch the current totalSupply of the LST and the total assets controlled by the protocol to calculate this rate. It's critical to inform users that staking is an on-chain transaction with gas costs and that their LST balance will be minted after the transaction is confirmed on the network.

The unstaking or withdrawal flow is more complex and often involves two steps: initiating a withdrawal request and claiming the unlocked assets. For protocols with instant liquidity (like Lido's stETH), this is a simple swap on a DEX. For protocols with a withdrawal delay (like EigenLayer or many rollup LSTs), the interface must track a user's withdrawal requests, display the remaining withdrawal period, and provide a function to claim the assets once the epoch or delay has passed. This requires listening to contract events like WithdrawalRequested and WithdrawalClaimed.

To ensure a robust interface, implement comprehensive error handling for insufficient balances, network changes, and contract revert reasons. Integrate real-time data updates using WebSocket subscriptions or frequent polling to reflect balance changes and staking rewards accrual. The UI should clearly distinguish between the user's wallet balance, their staked balance in the protocol, and any LST tokens they hold, as these represent different states of ownership and liquidity.

Here is a simplified code snippet illustrating the core staking interaction using ethers.js:

javascript
async function stakeETH(amount) {
  const stakingContract = new ethers.Contract(STAKING_ADDRESS, ABI, signer);
  const tx = await stakingContract.stake({ value: amount });
  await tx.wait(); // Wait for confirmation
  // Update UI: Fetch new user LST balance from contract
  const userBalance = await stakingContract.balanceOf(signer.address);
}

This function sends ETH to the contract and, upon confirmation, updates the displayed LST balance. The actual implementation must include pre-transaction checks for sufficient gas and balance.

Finally, the design must prioritize security transparency. Clearly explain to users that the protocol is non-custodial—they retain ownership of their LSTs, which are standard ERC-20 tokens in their wallet. Warn them to only interact with the official contract addresses. A successful interface reduces friction for users while accurately conveying the financial and technical implications of staking and unstaking, forming the foundation for user trust and protocol adoption.

data-display
FRONTEND INTEGRATION

Step 4: Displaying Real-Time Data and Analytics

This step focuses on building a dynamic dashboard to display live staking metrics, user balances, and protocol performance, which is essential for user trust and engagement.

A non-custodial staking interface must provide users with transparent, real-time data to make informed decisions. Your dashboard should display key metrics such as the Total Value Locked (TVL) in the Liquid Staking Token (LST) pool, the current Annual Percentage Yield (APY), and the exchange rate between the LST and the underlying staked asset (e.g., stETH/ETH). These figures are dynamic and should update without requiring a page refresh, typically by polling or subscribing to on-chain data via an indexer or your protocol's smart contracts.

To fetch this data, integrate with a provider like The Graph for indexed blockchain data or use a node RPC with multicall for direct contract queries. For example, you can query the totalSupply() of your LST token contract and the totalAssets() in the staking vault to calculate the TVL and exchange rate. The APY can be derived from the protocol's reward distribution mechanism, often requiring historical data analysis. Use libraries like ethers.js or viem to interact with contracts and React Query or SWR to manage state, caching, and automatic refetching intervals.

User-specific data is equally critical. For each connected wallet, display their current LST balance, the underlying asset value, and their estimated rewards. This requires reading from the user's LST token balance and the staking contract's reward accrual logic. Implement a clean, responsive UI with charts (using libraries like Recharts or Chart.js) to visualize historical APY trends and pool growth. Always include clear labels, tooltips explaining each metric, and links to block explorers for verification, reinforcing the non-custodial and transparent nature of your protocol.

MODEL COMPARISON

Fee Structures and Security Considerations

Comparison of key operational and security trade-offs for different LST launch models.

Feature / ConsiderationCentralized Staking PoolDecentralized Staking PoolNon-Custodial Interface

Protocol Fee on Yield

15-25%

5-15%

0-10%

Withdrawal Fee

0.5-2%

0.1-0.5%

0% (Gas only)

Validator Key Control

User Fund Custody

Slashing Risk on User

Exit Queue Control

Smart Contract Complexity

Low

High

Very High

Time to Launch

< 2 weeks

1-3 months

2-4 months

security-best-practices
LAUNCHING A LIQUID STAKING TOKEN

Step 5: Implementing Security and Best Practices

This section details the critical security architecture and operational best practices required to launch a non-custodial Liquid Staking Token (LST).

The security model for a non-custodial LST is fundamentally different from a traditional, centralized staking service. In a non-custodial system, user funds are never pooled into a single protocol-controlled wallet. Instead, each user's staking deposit is managed through a unique, user-owned smart contract vault or a secure Delegate Registry pattern. This architecture eliminates the single point of failure represented by a treasury contract holding millions in ETH. The core staking logic, including validator key generation and slashing management, is handled by a separate, audited set of contracts that never have custody of user principal.

Smart contract security is paramount. Your protocol's contracts must undergo rigorous audits from multiple reputable firms specializing in Ethereum staking, such as Trail of Bits, OpenZeppelin, or Spearbit. Key contracts to audit include the DepositContract wrapper, the NodeOperatorRegistry, the LST token contract (often an ERC-20 with rebasing or vault mechanics), and the withdrawal queue. Implement time-locked, multi-signature governance for all administrative functions, including oracle updates, fee parameter changes, and emergency pauses. Use established libraries like OpenZeppelin for access control (Ownable, AccessControl) and reentrancy guards.

Validator operation introduces unique risks. Your protocol must implement a robust slashing insurance mechanism. This typically involves over-collateralizing the node operator set or maintaining a dedicated insurance fund, funded by protocol fees, to cover any slashing penalties so that LST holders are made whole. The selection and rotation of node operators should be permissioned and governed, with clear performance metrics (uptime, commission) and the ability to safely exit validators. Use a decentralized oracle, like Chainlink or a committee of reputable entities, to relay validator status and balance proofs on-chain trustlessly.

For the user-facing interface, security extends to the frontend. Implement strict Content Security Policy (CSP) headers to prevent XSS attacks. Use subresource integrity (SRI) for all loaded scripts. The interface should clearly display the user's non-custodial vault address and provide a direct link to Etherscan. All transaction simulations should use a library like Tenderly or eth_estimateGas to preview outcomes and potential reverts. Warn users about the risks of signing messages that could delegate control of their vault.

Operational best practices are ongoing. Maintain a public bug bounty program on platforms like Immunefi to incentivize responsible disclosure of vulnerabilities. Publish transparent, real-time dashboards showing key metrics: total value locked (TVL), number of active validators, average validator effectiveness, and the status of the insurance fund. Establish clear, documented procedures for emergency responses, including a kill switch to pause deposits in the event of a critical vulnerability. Regular post-mortems for any incidents, even minor ones, build community trust.

Finally, educate your users. Your documentation should explicitly detail the trust assumptions: users trust the smart contract code and the node operator set, but not a central custodian. Provide clear guides on how to verify transactions on-chain and how to use the LST in DeFi protocols. By prioritizing these security and operational layers, you build a foundation of trust essential for a liquid staking protocol's long-term success.

LAUNCHING A LIQUID STAKING TOKEN

Frequently Asked Questions (FAQ)

Common technical questions and troubleshooting steps for developers building a non-custodial Liquid Staking Token (LST) interface.

A non-custodial Liquid Staking Token (LST) system separates the staking logic from the token logic. The core architecture typically involves three main smart contracts:

  1. Staking Vault Contract: Holds the native tokens (e.g., ETH, SOL) deposited by users. It interacts directly with the underlying chain's staking mechanism (e.g., Ethereum's Deposit Contract) to delegate or run validators. Users retain ownership of their stake via vault shares.
  2. LST ERC-20 Contract: A standard token (like ERC-20 or SPL) that represents a claim on the staked assets in the vault. Its total supply increases as staking rewards accrue and decreases with slashing penalties.
  3. Oracle/Update Contract: A mechanism to periodically update the exchange rate between the LST and the underlying asset. This contract reads the total value of the staking vault and calculates the value of 1 LST, ensuring the token remains properly collateralized.

The key non-custodial principle is that the user's keys never leave their control during the deposit/withdrawal process, often facilitated by using a proxy or wrapper contract that users approve for limited actions.

testing-deployment
LAUNCHING A LIQUID STAKING TOKEN

Step 6: Testing and Deployment

This final step covers the critical processes of testing your smart contracts and deploying them to a live network, culminating in the launch of your LST with a non-custodial interface.

Before any mainnet deployment, you must conduct exhaustive testing of your integrated system. This includes unit tests for individual contracts (e.g., staking vault, reward distributor) and integration tests that simulate the complete user flow: depositing ETH, minting LSTs, claiming rewards, and redeeming. Use a local Hardhat or Foundry development network to run these tests. For the non-custodial interface, write end-to-end tests using a framework like Cypress or Playwright to verify that frontend interactions correctly call the underlying smart contract functions. A comprehensive test suite is your primary defense against costly post-launch bugs.

After successful local testing, proceed to testnets like Goerli or Sepolia. Deploy your contracts using a script (e.g., npx hardhat run scripts/deploy.js --network goerli). This step validates your deployment process and allows for interaction in an environment that mimics mainnet conditions. It is crucial to test the frontend interface connected to these testnet contracts, ensuring wallet connections (via MetaMask or WalletConnect), transaction signing, and state updates work flawlessly. Engage a small group of beta testers to use the interface and provide feedback on the user experience and any edge cases you may have missed.

For mainnet deployment, security is paramount. Consider having your final audit report from a reputable firm like OpenZeppelin or Trail of Bits. Use a multisig wallet (e.g., Safe) as the owner/admin for your deployer contracts to enforce decentralized control. Execute the deployment script on the target network (Ethereum Mainnet, or an L2 like Arbitrum or Optimism). Verify and publish all contract source code on block explorers like Etherscan immediately after deployment. This transparency builds trust with users who can independently verify the non-custodial nature of your staking logic.

Once contracts are live, configure your production frontend to point to the verified contract addresses. Update environment variables and ensure your interface clearly displays the correct network. Key initial configurations include setting the staking reward rate, any early withdrawal fees, and the address of the reward distribution contract. Monitor the deployment using tools like Tenderly or OpenZeppelin Defender for real-time alerts on contract activity or anomalies. Your LST is now active, and users can begin staking through your non-custodial interface to mint liquid tokens representing their staked assets.

conclusion
IMPLEMENTATION SUMMARY

Conclusion and Next Steps

You have now implemented the core components for a non-custodial liquid staking token (LST). This guide covered the essential smart contracts and interface logic required for a secure, decentralized staking system.

Your implementation includes a staking pool contract that securely manages validator deposits, a rebasing LST token that automatically reflects accrued rewards, and a frontend interface that allows users to stake and unstake without relinquishing custody of their keys. The system's non-custodial nature is enforced by smart contract logic; user funds are only ever transferred to the official deposit contract on the Beacon Chain, never to a third-party wallet. This architecture mitigates centralization and custodial risks prevalent in early staking services.

To advance this project, several critical next steps are required. First, conduct a comprehensive security audit from a reputable firm like OpenZeppelin or Trail of Bits before mainnet deployment. Second, implement a decentralized oracle (e.g., Chainlink) or a committee of node operators to submit validator balance proofs and trigger rebase updates trustlessly. Finally, establish a governance framework (using a token like veLST) for community-led decisions on fee parameters, treasury management, and protocol upgrades.

For further development, consider integrating with DeFi primitives to enhance utility. Your LST can be used as collateral in lending markets like Aave, provided as liquidity in DEX pools on Uniswap V3, or incorporated into yield strategies via automated vaults. Explore cross-chain expansion using layer-2 solutions or appchains via interoperability protocols to tap into broader liquidity. Continuously monitor protocol metrics like total value locked (TVL), validator performance, and the LST's peg stability to inform iterative improvements.

The code and concepts from this guide provide a production-ready foundation. The final step is to transition from testnet to mainnet, which requires careful planning for the initial validator deposit, liquidity bootstrapping, and community launch. By following these steps, you can launch a robust, non-custodial LST that contributes to the security and liquidity of its underlying proof-of-stake network.