Thru Onboard is an unofficial community onboarding dApp for Thru Alphanet. It guides a new user through creating an account, claiming test THRU, launching a simple fungible token, and registering a name.
The app is built with Next.js 14, TypeScript, Tailwind CSS, and Thru's official web packages. Keys are generated and transactions are signed in the browser.
Alphanet only. Test tokens have no monetary value, and network state may be reset. Never use an account created here for real assets.
- Create or restore an account
- Generates a new Ed25519 keypair in the browser, or restores a returning user's account from a 64-character hexadecimal private key.
- Shows the Thru
ta...address. - Requires new users to download a JSON key backup before continuing.
- Offers optional WebAuthn passkey registration.
- Claim test THRU
- Creates the account on-chain when necessary.
- Submits the official faucet
withdrawinstruction directly from the browser. - Claims up to 10,000 base units and watches the live account balance.
- Links to the community ThruScan faucet as a backup.
- Launch a Simple Token
- Initializes a Token Program mint.
- Initializes the owner's deterministic token account.
- Mints an initial supply of 1,000,000 tokens to that account.
- Shows the mint and token-account addresses in the explorer.
- Register a name
- Derives and initializes a root registrar.
- Registers a subdomain and displays its on-chain addresses.
- Review the result
- Summarizes the account, token, and name.
- Provides copy controls and explorer links.
The implementation follows Thru's documented account and transaction model:
- The official Token Program owns two relevant account types:
TokenMintAccount, which stores token-wide configuration and supply, andTokenAccount, which stores an owner's balance for one mint. - Token creation uses the documented
initialize_mint,initialize_account, andmint_toinstruction sequence. - Mint addresses are derived from the mint authority and a seed. Token-account addresses are derived from the owner, mint, and seed.
- New mint, token, account, and name-service accounts use creating state proofs before their initialization transactions are submitted.
- Transaction account indices are resolved against the final sorted account list by the official SDK builders.
Official references:
- Next.js 14 with the App Router
- React 18 and TypeScript
- Tailwind CSS and Radix UI
@thru/sdkfor RPC, keys, state proofs, transaction construction, signing, submission, and tracking@thru/programs/tokenfor token address derivation and instruction builders@thru/passkeyfor optional WebAuthn support
Requirements:
- Node.js 18.18 or newer
- npm
npm install
cp .env.example .env.local
npm run devOpen http://localhost:3000.
Available checks:
npm run typecheck
npm run lint
npm run buildThe defaults target Thru Alphanet.
| Variable | Purpose | Default |
|---|---|---|
NEXT_PUBLIC_THRU_RPC_URL |
Browser RPC endpoint | https://rpc.alphanet.thru.org |
NEXT_PUBLIC_THRU_EXPLORER_URL |
Explorer base URL | https://scan.thru.org |
NEXT_PUBLIC_THRU_NETWORK |
Network label | Alphanet |
NEXT_PUBLIC_THRU_CHAIN_ID |
Transaction chain ID | 1 |
NEXT_PUBLIC_FAUCET_AMOUNT |
Requested faucet amount in base units | 10000 |
NEXT_PUBLIC_COMMUNITY_FAUCET_URL |
Backup web faucet | https://faucet.thruscan.net |
NEXT_PUBLIC_TOKEN_PROGRAM_ADDRESS |
Token Program address | Thru's built-in Token Program |
NEXT_PUBLIC_NAME_SERVICE_PROGRAM_ADDRESS |
Name Service Program address | Thru's built-in Name Service Program |
See .env.example for optional server-side faucet gateway
and relayer settings.
- Private keys are generated and used client-side.
- A private key is not sent to the app's server or the faucet.
- The wizard stores its state, including the testnet key, in browser
localStorageso a refresh does not lose progress. - Anyone with the downloaded key backup or browser-stored private key controls the account.
- Start over clears the saved wizard state from the current browser.
- This design is appropriate only for an experimental testnet onboarding tool.
The app can run on Vercel or any Node.js host:
npm run build
npm run startFor Vercel, import the GitHub repository, add any required values from
.env.example, and deploy. The primary browser faucet path does not require a
server-side operator key.
app/ Next.js routes and global styles
components/layout/ Header, footer, logo, and theme controls
components/ui/ Shared UI primitives
components/wizard/ Wizard state, navigation, and step screens
lib/thru/account.ts Account balance and nonce reads
lib/thru/client.ts Thru RPC client
lib/thru/deploy.ts Simple Token launch flow
lib/thru/faucet-onchain.ts Account creation and official faucet transaction
lib/thru/nameservice*.ts Name derivation and registration
lib/thru/keys.ts Browser key generation and backup
lib/thru/explorer.ts Explorer URL helpers
Thru documentation and Alphanet behavior are evolving. This repository pins
the Thru web packages to 0.2.39; revalidate program addresses, instruction
layouts, and network behavior when upgrading.