The foundational SDK for web3 and data
Lattice is a modular Swift SDK — eight packages that compose into hierarchical blockchains with verifiable Merkle state, content-addressed storage, peer-to-peer networking, and trustless cross-chain transfers. Build decentralized applications, verifiable data pipelines, or both.
Why Lattice
Most blockchain SDKs force you to choose between security, scalability, and developer experience. Lattice is designed from first principles so you don't have to. State is inherently verifiable. Chains scale horizontally without splitting security. Every layer is standalone — use the full SDK or pick the primitives you need.
The Storage Chain
Every piece of data flows through a tiered worker chain — fast to slow, local to remote. Misses walk forward; hits backfill backward. The chain self-optimizes without orchestration.
SDK Packages
Eight packages spanning blockchain, state, storage, networking, and reputation. Each is independently useful — compose them to match your use case, from a local verifiable data store to a full multi-chain network.
BlockChainSpecTransactionLatticeStateLatticeNode
MerkleDictionaryMerkleArrayMerkleSetNodeHeader
AcornCASWorkerContentIdentifierCompositeCASWorker
MemoryCASWorkerCASMetrics
DiskCASWorkerFileSystemProvider
TallyPeerLedgerChallenge
IvyRouterPeerConnectionMessageNetworkCASWorker
SDK Design Principles
Merkle State
All state is Cashew Merkle trees. Every mutation produces a new root CID. State is inherently versioned, verifiable, and efficiently syncable.
Content Addressing
All data identified by SHA-256 hash. Storage is inherently deduplicating, verifiable, and cacheable — same data, same CID, anywhere.
Actor Concurrency
Every worker is a Swift actor — compile-time data race safety. Sync hot paths bypass the executor via OSAllocatedUnfairLock for nanosecond reads.
Worker Chaining
Workers link via near/far references. The default get() walks fast→slow, backfilling on hits. The chain self-optimizes.
Quick Start
20 lines to verifiable storage
Full guide →import Acorn
import AcornMemoryWorker
import AcornDiskWorker
let memory = MemoryCASWorker()
let disk = await DiskCASWorker(
directory: "/tmp/lattice",
near: memory
)
let composite = CompositeCASWorker(farthest: disk)
// Store content-addressed data
let data = Data("Hello, Lattice".utf8)
let cid = await composite.store(data: data)
// Retrieve — walks memory → disk automatically
let result = await composite.get(cid: cid)
// First get: disk hit, backfills to memory
// Second get: memory hit in ~10ns
Dependency Graph
Platform Support
| Platform | Minimum Version |
|---|---|
| macOS | 13+ (Acorn/Workers), 14+ (Tally/Ivy) |
| iOS | 16+ (Acorn/Workers), 17+ (Tally/Ivy) |
| tvOS | 17+ |
| watchOS | 10+ |
| visionOS | 1+ |
| Linux | Swift 6.0+ |