Website: lithic.at • lithiclang.ai
Docs: docs.lithic.at
Created by: J. King Kasr
Maintained by: KaJ Labs
Network: Lithosphere
VM Target: LithoVM
Lithic is Lithosphere’s native smart-contract programming language for deploying AI-native applications onchain.
It is designed for:
- Typed AI services and async request/fulfill workflows
- Deterministic, consensus-safe execution targeting LithoVM
- Cost caps, per-user budgets, and programmable spend governance
- Capability-based permissions for safe system programming
- Cryptographic provenance receipts and audit-ready trace records
- Optional zk-verifiable AI execution for high-assurance workflows
- Secure, audited reference modules via LSCL (Lithosphere Secure Contracts Library)
ai.servicedeclarations with typed configurationai.request/ai.fulfilllifecycle- Async callbacks +
.timeout()handling - Receipt binding (model/input/output hashes) for verification
- Per-call max cost ceilings
- Per-user budgets and deterministic epochs
- Escrow locking + settlement patterns
- Explicit permissions for sensitive ops (AI calls, transfers, syscalls, zk verification)
- Principle-of-least-privilege by construction
lithccompiler (.lithic → LithoVM bytecode)lithfmtformatter +lithlintsecurity lints- LSP support (editor integrations)
- Deterministic devnet + fuzz harnesses + conformance tests
OpenZeppelin-like primitives for AI and assets:
- AgentWallet
- ToolRouter
- PolicyGuard
- BudgetGuard
- TraceRecorder
- NFT / Multi-token / Royalties / Metadata / Bridge interfaces
requires AI_CALL
contract RiskAnalyzer {
state { last_report: string }
ai.service GPT4 {
endpoint: "agii://provider42/gpt4"
max_cost: 10 LITHO
// zk_required: true // optional (LEP100-5)
}
public fn analyze(text: string) {
let req = ai.request GPT4 {
prompt: text,
temperature: 0.1,
max_tokens: 400
}
ai.fulfill(req) |response| {
self.last_report = response.text
}
.timeout(20 blocks)
.on_timeout { revert("AI timeout") }
}
}
Lithic is the reference language target for the LEP100 modular protocol stack:
- LEP100-1 — Lithic Core Specification
- LEP100-2..5 — AI providers, budgets, receipts, zk execution
- LEP100-6..13 — NFTs, composability, shared ownership, multi-token, royalties, metadata, marketplace hooks, bridge mint/burn
- LEP100-14 — Privacy-Preserving Account Linking (PPAL)
- lithc — compile, test, deploy
- lithfmt — canonical formatting
- lithlint — security checks (missing caps, unsafe async, budget misconfig)
- lithic-lsp — language server for IDEs
- Deterministic devnet runner
- AI mock provider + receipt verifier
- Fuzz testing harnesses
- LEP100 conformance test suite (1–14)
Lithic enforces capability-based permissions.
requires AI_CALL
requires TOKEN_TRANSFER
requires ZK_VERIFY
requires BRIDGE_MINT
requires PPAL_CONSUME
Contracts MUST explicitly declare sensitive privileges, enabling:
- safer audits
- safer deployment policies
- reduced accidental attack surface
lithic/
├─ compiler/ # lithc (frontend + IR + codegen)
├─ stdlib/ # standard library modules
├─ lscl/ # secure reference modules (optional subtree/submodule)
├─ specs/ # LEP100-1 (and related) language specs
├─ examples/ # sample contracts (AI, NFTs, bridges)
├─ tests/ # compiler + runtime tests
└─ docs/ # documentation site content
# clone repo
git clone https://github.com/KaJLabs/lithosphere.git
cd lithosphere/lithic
# build compiler
make build
# compile contract
lithc compile examples/risk_analyzer.lithic
# run tests
make test
- Core language specification
- AI async execution model
- Capability security model
- Full zk-verifiable pipeline
- Formal verification toolkit
- Production IDE extensions
Contributions are welcome from the community.
- Fork the repository
- Create a feature branch
- Submit a pull request
Please follow coding standards and include tests where applicable.
Lithic is created by J. King Kasr and maintained by KaJ Labs for the Lithosphere ecosystem.
Apache-2.0