Getting Started with Lichen
This guide walks you through everything needed to go from zero to your first on-chain transaction. You'll install the toolchain, create a wallet, fund it on testnet, send a transfer, and deploy a minimal smart contract.
Prerequisites
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup default stable
rustup update
wasm32-unknown-unknown compilation target for smart
contract builds.rustup target add wasm32-unknown-unknown
# Using nvm (recommended)
nvm install 20
nvm use 20
# Verify
node --version # v20.x.x
npm --version # 10.x.x
lichen-validator release artifact, you can join mainnet directly
without a repository checkout. Use a writable state directory plus domain bootstrap peers like
seed-01.moltchain.network:8001, seed-02.moltchain.network:8001, and
seed-03.moltchain.network:8001. See Validator Setup for Linux,
macOS, and Windows release install commands.
Install the CLI
The molt CLI is your primary interface for interacting with the Lichen network. Install
it from crates.io or build from source.
Option A: Install from crates.io
cargo install lichen-cli
Option B: Build from source
git clone https://github.com/lobstercove/moltchain.git
cd lichen
cargo build --release
# Binary is at ./target/release/molt
cp target/release/molt ~/.cargo/bin/
Verify the installation:
$ licn --version
lichen-cli 0.9.2 (lichen)
Make molt discoverable in new spores
echo 'export PATH="$HOME/.cargo/bin:$HOME/.lichen/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
command -v molt
If command -v molt is empty, run the binary directly until your shell profile is fixed:
./target/release/molt --version
Create a Wallet
Generate a new keypair. This creates an Ed25519 private key and derives your Lichen address.
$ licn wallet create
Generating new Lichen keypair...
Name: wallet-1
Address: Mo1tABcDeFgH1jK2LmNoPqRsTuVwXyZ3456789ab
Path: ~/.lichen/wallets/wallet-1.json
Done! Fund your wallet with testnet tokens to get started.
You can also import an existing keypair file:
$ licn wallet import my-wallet --keypair ~/backup/wallet.json
Get Testnet Tokens
You need LICN tokens to pay for transaction fees and contract deployments. On testnet, you can request free tokens from the faucet.
Option A: Web Faucet
Visit the Lichen Faucet and paste your address. You'll receive 10 LICN on testnet within seconds.
Option B: CLI Faucet
$ licn airdrop 10 --rpc-url https://testnet-rpc.moltchain.network
Requesting 10 LICN airdrop...
Transaction: 4xK9...mNpQ
New balance: 10.000000000 LICN
Airdrop successful!
First Transfer
Send LICN from your wallet to another address. This is the simplest transaction on Lichen.
$ licn transfer 1.5 Mo1tRecipientAddress123456789abcdefghijk \
--rpc-url https://testnet-rpc.moltchain.network
Sending 1.5 LICN...
From: Mo1tABcDeFgH1jK2LmNoPqRsTuVwXyZ3456789ab
To: Mo1tRecipientAddress123456789abcdefghijk
Amount: 1.500000000 LICN
Fee: 0.001000000 LICN
Transaction: 7zQ3...bRtW
Status: Finalized (slot 482,917)
Transfer complete!
Verify the transaction in the Block Explorer by searching for the transaction hash.
Deploy a Contract
Let's deploy a minimal "Hello World" smart contract. Lichen contracts are written in Rust and compiled to WASM.
$ cargo new --lib hello-world
$ cd hello-world
$ cargo add lichen-contract-sdk
src/lib.rs and add the contract logic.use lichen_sdk::prelude::*;
#[lichen_contract]
mod hello_world {
use super::*;
/// Store a greeting message on-chain.
pub fn set_greeting(ctx: Context, message: String) -> Result<()> {
let greeting_account = &mut ctx.accounts.greeting;
greeting_account.message = message.clone();
greeting_account.author = ctx.caller();
emit_event("GreetingSet", &message);
Ok(())
}
/// Read the current greeting.
pub fn get_greeting(ctx: Context) -> Result<String> {
Ok(ctx.accounts.greeting.message.clone())
}
}
#[account]
pub struct GreetingAccount {
pub message: String,
pub author: Pubkey,
}
$ cargo build --target wasm32-unknown-unknown --release
Compiling hello-world v0.1.0
Finished release [optimized] target(s) in 8.42s
$ licn deploy target/wasm32-unknown-unknown/release/hello_world.wasm \
--rpc-url https://testnet-rpc.moltchain.network \
--symbol HELLO --name "Hello World" --template infra
Deploying contract...
Program ID: Mo1tProg1D...xYz789
Symbol: HELLO
Template: infra
Size: 14,832 bytes
Deploy tx: 9kR7...sWmN
Fee: 25.001000000 LICN
Status: Finalized
Contract deployed successfully!
Interact via:
licn call Mo1tProg1D...xYz789 set_greeting '["Hello, Lichen!"]'
--symbol to register in the symbol registry during deploy.
Upgrades cost 10 LICN plus the base fee. Regular contract calls only pay the 0.001 LICN
base fee.
Next Steps
You've created a wallet, funded it, sent a transfer, and deployed a contract. Here's where to go next: