A secure, Rust-based CLI wallet and library for Starknet.
- π€ AI-First Design: Native JSON output (
--json), secure non-interactive mode, and MCP Server support for autonomous agents. - π± DEX Integration: Built-in AVNU swap aggregator support for best-price execution and token discovery.
- π¦ Degen UX: High-speed TUI with arrow-key menus, ASCII banners, and live spinners for humans.
- π‘οΈ Secure Keystore: Encrypted local storage for private keys using AES-256-GCM and Argon2.
- β‘ Starknet Integration: Native support for Starknet accounts (OpenZeppelin), transfers, and deployments.
- π¦ Library Support: Can be used as a Rust crate in other projects.
Ensure you have Rust installed.
git clone https://github.com/0xcrypto2024/stark-ark.git
cd stark-ark
cargo install --path .Before using StarkArk, you need to configure the RPC endpoint and other settings.
-
Initialize Configuration: Run the following command to generate a default configuration file in your system's config directory:
stark-ark config init
-
Edit Configuration: The command above will tell you where the file was created. Open it and set your
STARKNET_RPC_URLand optionallySTARK_ARK_PASSWORDfor autonomous mode.STARKNET_RPC_URL=https://starknet-sepolia.public.blastapi.io # Optional: For autonomous AI Agent / MCP usage without prompts STARK_ARK_PASSWORD=my_secure_wallet_password
-
Check Configuration: Verify your settings:
stark-ark config show
StarkArk is built to be the best Starknet wallet for AI Agents.
StarkArk transforms into an MCP server, allowing AI agents (like Claude Desktop) to directly "see" and "use" your wallet safely.
Prerequisites:
- Set
STARK_ARK_PASSWORDin your environment or.envfile.
Run Server:
stark-ark mcpExposed Tools:
list_accounts(): View all available wallet accounts.get_balance(token_symbol, account_address?): Check holdings. If address is omitted, scans all accounts for ETH, STRK, and Staked STRK.stake(amount, validator_address, account_address?): Delegate STRK to a validator.unstake(amount, pool_address, account_address?): Signal intent to unstake.withdraw_unstaked(pool_address, account_address?): Withdraw unbonded funds.swap(sell, buy, amount, account_address?): Execute swaps via AVNU.transfer(to, amount, account_address?): Send STRK.
Once connected, you can simply ask Claude in natural language:
- Check Balance: "What are my balances?" (Scans all accounts) or "Check ETH on my main account."
- Manage Accounts: "List all my wallet accounts."
- Staking:
- "Stake 100 STRK to 0x123..."
- "Unstake 50 STRK from 0x123..."
- "Withdraw my unstaked funds."
- Swap: "Swap 10 STRK for ETH using my second account."
- Transfer: "Send 5 STRK to 0x123..."
Claude will verify the tool call with you before executing any transaction.
Imagine asking Claude to manage your portfolio purely through natural language.
User: "Check my balances. If I have more than 100 STRK, swap half of it to ETH and stake the rest to the default validator."
Claude (Agent):
- Calls
get_balance(): "You have 500 STRK and 0.1 ETH on your main account." - Reasoning: "500 > 100. I need to swap 250 STRK to ETH and stake 250 STRK."
- Calls
swap(sell="STRK", buy="ETH", amount=250): Executes swap via AVNU. - Calls
stake(amount=250, validator="0x..."): Delegates remaining funds.
Result: Your portfolio is rebalanced and staking rewards are active, all from one sentence.
To use StarkArk with Claude Desktop, edit your claude_desktop_config.json file:
- MacOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Add the following entry:
{
"mcpServers": {
"stark-ark": {
"command": "/absolute/path/to/stark-ark",
"args": ["mcp"],
"env": {
"STARKNET_RPC_URL": "https://starknet-sepolia.public.blastapi.io",
"STARK_ARK_PASSWORD": "your_wallet_password",
"KEYSTORE_FILE": "/absolute/path/to/keystore.json",
"STRK_CONTRACT_ADDRESS": "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d",
"OZ_CLASS_HASH": "0x061dac032f228abef9c6626f995015233097ae253a7f72d68552db02f2971b8f",
"STAKING_CONTRACT_ADDRESS": "0x03745ab04a431fc02871a139be6b93d9260b0ff3e779ad9c8b377183b23109f1"
}
}
}
}Tip: Run
which stark-ark(orpwdin the target dir) to find the absolute path to the binary. EnsureKEYSTORE_FILEpoints to the correct location if it's not in the default directory.
Use the --json flag to get strict, structured JSON output for parsing if you are building your own wrapper.
stark-ark --json balance --index 0
# Output: {"index":0,"address":"0x...","balance":100.0,"unit":"STRK"}StarkArk can be used in Interactive Mode (by running without arguments) or CLI Mode.
Run stark-ark without arguments to enter the TUI mode.
- Arrow Keys β¬οΈ β¬οΈ: Navigate menus.
- Enter β΅: Select options.
- Real-time Spinners: Watch network operations in style.
- Dynamic Token Balances: Automatically scans and displays your token holdings.
stark-arkGenerate a new private key and add it to your keystore.
stark-ark newView all accounts managed by the keystore.
stark-ark listImport an existing private key or a JSON account config.
# Interactive import (recommended)
stark-ark importSwap tokens directly from the CLI using the AVNU aggregator.
# Swap 10 STRK for ETH
stark-ark swap --sell STRK --buy ETH --amount 10 --index 0Supports both tickers (STRK, ETH, USDC) and contract addresses.
View the list of tokens supported by AVNU.
stark-ark tokensCheck the STRK balance of a specific account (by index).
stark-ark balance --index 0Deploy the account contract to the Starknet network.
stark-ark deploy --index 0Send STRK to another address.
stark-ark transfer --from-index 0 --to 0x123... --amount 1.5Export the private key or full account configuration (JSON) for backup.
stark-ark export --index 0Delegate STRK tokens to a validator to earn rewards.
stark-ark stake --index 0 --amount 10 --validator 0x123...βοΈ Securely backup your encrypted keystore to Google Drive.
Prerequisites:
Enable Google Drive API and set GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET in .env.
# Upload keystore to Google Drive
stark-ark backup
# Restore keystore from Google Drive
stark-ark restoreMIT