Getting Started

Run AI inference on a decentralized peer-to-peer network. Install the SDK, create a wallet, connect to the mesh, and infer. Total time: under 2 minutes.

1. Install the SDK

# Python
pip install arknet-sdk

# Rust
cargo add arknet-sdk

# TypeScript / Node.js (coming soon — p2p update pending)
npm install arknet-sdk

2. Create a wallet

Your wallet is your identity on the network. It is an Ed25519 keypair stored at ~/.arknet/wallet.key.

Python

from arknet_sdk import Wallet

wallet = Wallet.create()
wallet.save()                # saves to ~/.arknet/wallet.key
print(wallet.address)        # your address on the network

Rust

use arknet_sdk::wallet::Wallet;

let wallet = Wallet::create();
wallet.save()?;

Or use the CLI: arknet wallet create

3. Create a session key

Session keys let you authorize inference spending without exposing your main wallet key. Your wallet signs a delegation certificate that grants an ephemeral key a spending limit and expiry.

Python

session = wallet.create_session(
    spending_limit=100_000_000,   # 1 ARK in atoms
    expires_secs=3600,            # 1 hour
)

Rust

use std::time::Duration;
use arknet_sdk::session::SessionKey;

let session = SessionKey::create(
    &wallet,
    100_000_000,
    Duration::from_secs(3600),
)?;

4. Connect to the mesh

The SDK joins the arknet P2P network as a lightweight libp2p peer. It connects to a validator seed, subscribes to compute node announcements via gossip, and is ready to send inference.

Python

from arknet_sdk import Client

client = Client.connect(session=session)

Rust

use arknet_sdk::{Client, ConnectOptions};

let client = Client::connect(ConnectOptions {
    session: Some(session),
    ..Default::default()
}).await?;

5. Run inference

Python

response = client.infer(
    model="Qwen/Qwen3-0.6B-Q8_0",
    prompt="Hi, how are you?",
    max_tokens=64,
)
print(response.text)

Rust

use arknet_sdk::InferRequest;

let response = client.infer(InferRequest {
    model: "Qwen/Qwen3-0.6B-Q8_0".into(),
    prompt: "Hi, how are you?".into(),
    max_tokens: 64,
    ..Default::default()
}).await?;
println!("{}", response.text);

Full example (Python)

from arknet_sdk import Wallet, Client

wallet = Wallet.create()
wallet.save()
session = wallet.create_session(spending_limit=100_000_000, expires_secs=3600)
client = Client.connect(session=session)

response = client.infer(
    model="Qwen/Qwen3-0.6B-Q8_0",
    prompt="Explain arknet in one sentence.",
    max_tokens=100,
)
print(response.text)

Bootstrap period (first 6 months): Inference is free. No ARK balance needed. Each wallet gets 10 free jobs per hour and 100 per day. After the bootstrap period, inference is paid from your ARK balance. See Tokenomics.

How it works

There is no HTTP anywhere. The SDK is a libp2p peer that:

  1. Bootstraps from seed validators listed in seeds.json
  2. Discovers compute nodes via gossip (arknet/pool/offer/1 topic)
  3. Connects to a compute node through the validator relay, then hole-punches a direct connection via DCUtR
  4. Sends inference signed by your session key, receives the response

Prompts travel only between your machine and the compute node. No middleman sees your data.

Next steps