Get Started
Using Lightchain Studio
Everything Lightchain in Studio is in four places:- The status bar (bottom left): your active account, your credits and the network. Click it for the wallet menu.
- The Lightchain side bar (right): Deployed Programs above, the Lightchain AI panel below. It opens by itself the first time you start Studio.
- The Command Palette: every command below is under the Lightchain or Lightchain Wallet category.
- The Start page, shown when no editor is open: New Project, Open Folder, Clone Repository, recent projects, and links such as the testnet faucet.
Wallet
Click the status bar item (it reads Connect Wallet until you have an account) to open the wallet menu.Local accounts
Private keys are kept in the IDE's secret storage, which is encrypted with your operating system's key store (the Keychain on macOS). Account names and addresses are stored separately and are not secret. A key never reaches a web view orforge.
Browser wallet
Connect Browser Wallet opens a Lightchain Studio page in your default browser, served by Studio itself from your own machine. Pick your wallet there (MetaMask, Rabby, Coinbase Wallet, Brave Wallet, or any wallet extension that announces itself). No WalletConnect project ID is involved.- Keep that tab open. Every request from Studio (a sign-in, a top-up, a deploy, a contract call) appears in the tab's Activity list and in your wallet. If the tab is closed when a request comes in, Studio opens it again.
- Before sending a transaction, the page switches your wallet to the Lightchain network, and adds the network to the wallet if it is missing.
- The wallet must be on the account Studio has connected. If you switched accounts in the wallet, the page asks you to switch back.
- A request you don't answer within 5 minutes fails.
- Disconnect Wallet in the wallet menu forgets the browser wallet.
http://localhost:3000 when nothing else is using port 3000. Otherwise it uses http://127.0.0.1 on a port Studio picks once and keeps, so your wallet's site permissions survive restarts.
Mainnet
On mainnet, every transaction Studio sends (from either kind of account) first shows a confirmation with what it does, the sending account, the value and the estimated network fee. Nothing is sent until you click Send on Mainnet.Credits
Lightchain AI is paid from your credits: your prepaid LCAI balance in the network'sJobRegistry contract. It is the same balance the Lightchain AI chat and the Developer API spend from.
delegate is the address the Lightchain AI server submits jobs from; Studio reads it from the server. The allowance is set to your prepaid balance at the moment you click Allow. It caps what the server can spend from your credits, and it does not grow by itself when you top up later.
Withdrawing never needs the server: it is your wallet calling the contract. The status bar shows your credits; its tooltip also shows your wallet's LCAI balance.
Lightchain AI
The Lightchain AI panel is a coding agent. It reads your project, proposes file changes and commands, and you approve each one. Every reply from the model is one inference job on the Lightchain network.Before your first prompt
- Open a folder, and trust it when Studio asks: the agent does not run in Restricted Mode.
- Connect a wallet and top up credits. The panel won't send a prompt while your credits are below 0.02 LCAI. That is the lowest fee per job; the actual fee depends on the model (set per model in
AIConfig, for example 0.02 LCAI forllama3-8band 0.15 LCAI forllama3-70b). - Sign-in. The first prompt signs you in to Lightchain AI with a Sign-In with Ethereum message. It sends no transaction and costs no gas. The sign-in lasts one hour and is shared by every chat; a local account signs by itself, a browser wallet asks you.
- Allow. If your wallet has not yet authorized the Lightchain AI server, the panel shows an Allow card. Approving it sends the transactions in Credits and then sends your prompt.
Models
The model menu lists the coding models the network serves right now, with a dot for each model's worker availability:qwen3-coder-next, glm-4.7-flash, llama3-70b, qwen3.6:27b, deepseek-r1:32b, mistral-small:24b, gemma4:26b, llama3-8b
Studio keeps the model you picked as long as the network serves it. Until you pick one, it takes the first available model in the order above. Other models the network serves (very small models, vision, speech and embedding models) are not offered, because they cannot drive the agent's tools reliably. Changing the model starts a new chat, because a Lightchain session is bound to one model.
What the agent sees
Each prompt carries context from the editor:- the file you are looking at, and your selection in it;
- files you mention with
@(up to 8); - the errors and warnings in those files (up to 20).
What the agent can do
The file tools only reach files inside the project folder, symbolic links included. Every file change is a complete new version of the file, shown to you as a diff:- Accept (
⌘/Ctrl+Enter) or Reject (⌘/Ctrl+Backspace) the whole proposal. - When a proposal has more than one change, each change has a Keep toggle. Switch some off and Accept: only the kept changes are written, and the agent is told which ones you declined.
- Click the file name to open the proposal in the full diff editor.
forge build. If the build fails, it gives the errors back to the agent to fix, up to two rounds.
The agent takes at most 12 steps per request, and stops early after 3 steps in a row in which every tool call failed, so a confused model doesn't keep spending credits.
Undo
After a turn that changed files, the panel shows the files with an Undo button. Undo puts every file back the way it was before that turn and moves files the turn created to the trash. If you edited a file after the agent wrote it, Studio asks before discarding your edits.Chats
Chats are saved per project, up to 30, and shown again when you reopen Studio; older chats are under History. Continuing a saved chat starts a new session with a worker, and the first prompt carries a short recap of the chat's last turns.When a worker stalls
- If no answer starts within 45 seconds of the job being submitted, the panel offers to send the same prompt to up to three other models with free workers, or to keep waiting.
- If a worker fails or stops answering, Studio retries once by itself, on another model with free workers or on a new session (and usually a new worker) for the same model.
- If the network fails to submit the job on chain, Studio tries once more. If that fails too, nothing is charged and you can send the prompt again.
JobRegistry lets it be settled: 48 hours after the job's deadline (the AIConfig resolution timeout, 172,800 s on both networks today). Studio remembers such jobs; once they can be settled, the panel offers to reclaim their fees, with one settleStuckJob(jobId) transaction per job. The fee goes back to your credits.
In the editor
Submission failures and worker error reports (job id and error code, with the encrypted payload left out) are logged to the Lightchain AI output channel.Foundry
The build commands need a Foundry project: a folder withfoundry.toml. Studio finds forge at the path in lightchain.foundry.path, else ~/.foundry/bin/forge, else on your PATH. If it isn't installed, Studio offers to install Foundry with foundryup.
Compiler errors and warnings from Build and Test appear in the Problems panel.
Deploy Script
Run it from the Command Palette, from the deploy button in the title bar of an open*.s.sol file, or from the Explorer context menu on one. Without a script open, Studio lets you pick one from script/. It shows the network and the signing account, then offers Deploy or Deploy & Verify, and runs:
CodeBASH
--account <name>.
Deploy Contract
Deploy Contract… (also the rocket in the Deployed Programs header, and Deploy above eachcontract in a Solidity file under src/) builds the project, lists the deployable contracts compiled from src/, asks for each constructor argument (arrays and tuples as JSON) and for an LCAI value if the constructor is payable, confirms, and sends the deployment from your active account. The new contract is added to Deployed Programs, and you can open Interact or Lightscan from the result.
New Lightchain Project
New Lightchain Project (Start page or Command Palette) asks for a template, a parent folder and a name: Each template is self-contained Solidity (pragma solidity ^0.8.24) with src/, a test in test/ and script/Deploy.s.sol. Studio also writes a README.md, a .gitignore, and a foundry.toml with both networks set up:
CodeTOML
forge is installed, Studio runs git init and forge install foundry-rs/forge-std in the new project, then opens it.
Deployed Programs
The Deployed Programs view lists contracts on the current network, for the open project. It merges three sources: A filled check means the contract's address appears somewhere in your project's files (folders inlightchain.programs.scanExclude are skipped); expand it to jump to each place. An empty circle means it isn't referenced.
On each contract: Interact, Open in Lightscan, Copy Address, Find in Project, and Remove for contracts you added by hand. The header has Deploy Contract, the network switch, Add Contract and Refresh; its menu has Deploy Script and Set Deployer Address.
Switching networks
Use the switch in the Deployed Programs header, or Lightchain: Switch to Mainnet / Switch to Testnet. The choice is saved per project and applies to the whole IDE: the status bar, credits, Lightchain AI, deploys and Deployed Programs.Interact
Interact opens a tab with the contract's functions, split into Read and Write. Studio finds the ABI in this order: a Foundry artifact named like the contract; a Foundry artifact whose runtime bytecode matches the code on chain; the verified source on Lightscan; otherwise it asks you for an ABI file (a JSON array, or a Foundry artifact).- Reads are free calls. Reads without arguments show their value as soon as the tab opens.
- Writes are simulated first, so a revert shows its reason before anything is signed. Then a local account confirms in a dialog (on mainnet, in the mainnet confirmation), and a browser wallet confirms in the wallet. After a write, the reads refresh.