Skip to main content

Empyreals

Project completed

Empyreals Staking

Empyreals Staking: a points-based NFT staking program on Solana that Builderz built for The Empyreals with Rust, Anchor and TypeScript.

  • Blockchain

Project Overview

Review the retained technical record, delivery approach, and available evidence for this historical project.

Project Details

Client

Empyreals

Empyreals Staking: a points-based NFT staking program on Solana that Builderz built for The Empyreals with Rust, Anchor and TypeScript.

Industry

Blockchain

Timeline

Custom timeline

From concept to deployment

Services Provided

Blockchain

Tech Stack

SolanaRustTypeScriptAnchorWeb3.js

Recorded historical evidence

Work recorded: Blockchain

About the project

We developed a point based NFT staking solution for The Empyreals project on Solana.

Constraint

The challenge

The Empyreals wanted holders to stake their NFTs and earn points for it. A staking system like this has two jobs: keep each holder's claim on their NFT clear while it's staked, and keep a points balance the browser can't edit.

Approach

The solution

The staking program is written in Rust with the Anchor framework and connected to a TypeScript front end through web3.js.

Project overview

Empyreals Staking is a points-based NFT staking solution that Builderz developed for The Empyreals project on Solana.

In an Anchor staking program of this kind, staking an NFT creates a stake record: an account derived from the NFT mint and the owner that stores who staked it and when. Points come from elapsed time multiplied by a rate, so the program can compute them on demand instead of updating every account on a timer. Unstaking closes the record and returns its rent.

Custody is the main decision. One option moves the NFT into a program-owned account until the holder unstakes. The other leaves it in the holder's wallet and freezes it there, so it still shows up in their wallet while it can't be sold or moved. Holders tend to prefer the second; the first is simpler to reason about. Anchor's account constraints check that the signer owns the NFT and that the stake record matches it, which is where staking bugs usually hide.

If you're planning staking for a collection or token, settle the reward formula, the custody model and who holds the program's upgrade authority before writing code. Our guide to planning token and NFT staking covers those choices, the Solana DeFi development page covers the build, and a program that holds user assets should go through audit preparation before mainnet.

22
Published Case Studies
2021
First Published Solana Build
Public
Code and Process

More of our work

All work

Plan a production build · Priced by project type

Want to turn this into a real build?

Book an intro call, or send a brief about the requirements for a similar production system, the problem, and your budget. We reply within one business day.

Prefer proof first? See related work.