Production implementation of the L{CORE} SDK for Locale Network's decentralized city data infrastructure.
Built on lcore-sdk by Modern Society Labs.
Locale City Chain enables cities and municipalities to:
- Verify off-chain data from trusted sources via TEE attestation
- Store attestations in a deterministic, auditable rollup
- Control access to sensitive data with granular permissions
- Define schemas for standardized data providers
┌─────────────────────────────────────────────────────────────┐
│ Locale City Chain │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────────┐ ┌─────────────────────────────┐ │
│ │ Attestor │ │ City Chain Rollup │ │
│ │ │ │ │ │
│ │ - TLS Verification │ │ - Attestation Storage │ │
│ │ - ZK Proofs │───▶│ - Access Control │ │
│ │ - TEE Signing │ │ - Provider Schemas │ │
│ │ │ │ - Data Discovery │ │
│ └─────────────────────┘ └─────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
locale-city-chain/
├── attestor/ # Attestation infrastructure
│ ├── src/
│ │ ├── server/ # Attestor server
│ │ ├── providers/ # Data providers
│ │ └── utils/ # Utilities
│ └── package.json
├── cartesi/ # City Chain rollup
│ ├── src/
│ │ ├── lcore-main.ts # City Chain entry point
│ │ ├── lcore-db.ts # Attestation schema
│ │ ├── handlers/
│ │ │ ├── lcore-attestation.ts # Attestation CRUD
│ │ │ ├── lcore-access.ts # Access control
│ │ │ ├── lcore-schema.ts # Provider schemas
│ │ │ └── lcore-discovery.ts # Data discovery
│ │ └── utils/
│ └── package.json
└── README.md
Store and retrieve verified attestations:
// Create attestation
POST /attestation/create
{
"bucket_id": "utility-bills",
"provider_hash": "0x...",
"data": { ... },
"signature": "0x..."
}
// Query attestations
POST /attestation/query
{
"bucket_id": "utility-bills",
"filters": { "provider": "electric-company" }
}Granular permissions for data access:
// Grant access
POST /access/grant
{
"bucket_id": "utility-bills",
"grantee": "0x...",
"permissions": ["read", "query"]
}
// Revoke access
POST /access/revoke
{
"grant_id": "..."
}Define standardized data formats:
// Register schema
POST /schema/register
{
"provider_hash": "0x...",
"schema": {
"type": "object",
"properties": { ... }
}
}Aggregate statistics and search:
// Get bucket stats
POST /discovery/stats
{
"bucket_id": "utility-bills"
}
// Search attestations
POST /discovery/search
{
"query": "electric",
"filters": { ... }
}| Table | Purpose |
|---|---|
attestations |
Verified data attestations |
attestation_buckets |
Logical groupings of attestations |
attestation_data |
Attestation payload storage |
access_grants |
Permission management |
provider_schemas |
Data format definitions |
schema_admins |
Schema management permissions |
- Node.js 18+
- Docker (for Cartesi)
- Foundry (optional, for contract development)
# Clone the repository
git clone https://github.com/Locale-Network/locale-city-chain.git
cd locale-city-chain
# Install attestor dependencies
cd attestor && npm install
# Install cartesi dependencies
cd ../cartesi && npm install# Attestor configuration
cp attestor/.env.example attestor/.env
# Edit with your configuration
# Cartesi configuration
export ROLLUP_HTTP_SERVER_URL=http://localhost:5004# Terminal 1: Start attestor
cd attestor && npm run start
# Terminal 2: Start Cartesi rollup
cd cartesi && npx @cartesi/cli run# Build Docker image
cd attestor && npm run docker:build
# Get image hash for TEE registration
npm run docker:image-hash
# Deploy to EigenCloud platform# Build for production
cd cartesi && npm run build
# Deploy using Cartesi CLI
npx @cartesi/cli deploy --network mainnetFull documentation available on GitBook (coming soon).
| Repository | Description |
|---|---|
| lcore-sdk | Generic SDK template |
| attestor-core | Attestation infrastructure |
| lcore-console | Management dashboard |
AGPL v3