🎉 The #CandyDrop Futures Challenge is live — join now to share a 6 BTC prize pool!
📢 Post your futures trading experience on Gate Square with the event hashtag — $25 × 20 rewards are waiting!
🎁 $500 in futures trial vouchers up for grabs — 20 standout posts will win!
📅 Event Period: August 1, 2025, 15:00 – August 15, 2025, 19:00 (UTC+8)
👉 Event Link: https://www.gate.com/candy-drop/detail/BTC-98
Dare to trade. Dare to win.
Solana NFT: Exploring Token-based User Sign Up and Identification
Explore using Solana Token as user sign up credential
NFT (non-fungible token) as a "non-replaceable" token is very suitable for use as an identity verification tool. This article will explore the feasibility of using NFT as a sign up credential through a simple example.
Tool Introduction
SPL Token
Solana provides a universal Token Program implementation, which is part of the Solana Program Library (SPL). SPL includes several commonly used program implementations such as Token, Swap, and Memo, and provides a complete client library and CLI tools, greatly facilitating Solana developers.
Solana Playground
Solpy provides an online environment for writing and deploying Solana contracts, which comes with some commonly used tools by default, such as SPL Token. We can easily create and manage Tokens using spl-token-cli.
Create Authentication Token
We will create an NFT Token. If the user mints the Token, it is considered that this wallet address has signed up in the system; otherwise, prompt the user to sign up first.
Create Token
Create a new indivisible Token using spl-token:
spl-token create-token --decimals 0
The Mint Address in the output is the Token ID that was created.
Create Token Account
Create a Token Account for the Token created in the previous step:
spl-token create-account <token_id>
Mint Token
Try to mint a Token unit for the Token Account:
spl-token mint <token_id> 1
You can also try minting to a specified wallet address:
spl-token mint <token_id> 1 <wallet_address>
Note: Directly minting to a wallet address will fail; you need to create a Token Account for the wallet address first.
Create Token Account for wallet address ###
Use the following command to create a Token Account for the specified wallet address:
spl-token create-account <token_id> --owner <wallet_address>
Get Token Account
Use the getTokenAccountsByOwner method of the RPC interface to check if the wallet address has minted the NFT we created.
Implementing a Login System
Create a project using Nextjs and implement wallet connection functionality using Ant Design Web3.
The main page includes:
Login process:
sign up process:
You can check relevant transaction data through Solscan, including CreateAccount instructions and Mint operations.
Summary
We created an NFT using spl-token-cli and determined whether the user is registered by checking if the wallet address has a Token Account and has minted a Token. When the user connects their wallet, the system automatically creates a Token Account and mints a Token unit as a registration credential. After that, the user can log in to the website using the same wallet address.