You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SIVeL 3 is a Web3 protocol for the ethical and sustainable documentation of socio-political violence, operating live at https://sivel.xyz. The platform integrates an existing information system (sivel2) with new blockchain technologies to create an immutable and transparent record of cases, funded through a donation-based model with SLEARN cashback rewards.
System Architecture Diagram
graph TD
subgraph Users
CZ[Citizen]
DC[Documenter]
DN[Donor]
end
subgraph "sivel3agent (AI)"
AG[AI Agent<br/>Qwen2.5-7B]
AG -->|publishPreAlert| PM
end
subgraph "sivel.xyz Platform"
NX[Next.js Frontend]
API[Next.js API Routes]
DB[(PostgreSQL)]
S2[Sivel 2 Rails]
end
subgraph "Celo Blockchain"
RD[SIVeL3RegionalDonationV2]
PM[SIVeL3PreAlertMarket]
RE[SIVeL3RewardEscrow]
CR[PasosDeJesusCredentials]
SL[SLEARN Token]
end
subgraph "Ecosystem"
LT[learn.tg<br/>KYC + Courses]
SS[stable-sl.pdJ.app<br/>SLEARN redemption]
end
CZ -->|views map + pre-alerts| NX
CZ -->|buys pre-alert ($1 USDT)| PM
CZ -->|converts to alert| API
DC -->|scores alert (EIP-191)| API
DN -->|donates USDT| NX
API -->|90% assignDonation| RD
API -->|10% mintAndReserve| SL
API -->|withdraw + releasePayment| RE
API -->|verify KYC| LT
NX -->|SBT minting| CR
SS -->|redeem SLEARN| SL
style PM fill:#f9f,stroke:#333
style RE fill:#f9f,stroke:#333
style SL fill:#fca,stroke:#333
style LT fill:#bbf,stroke:#333
Loading
Architecture Stack
1. Main Backend: Sivel 2 (Legacy)
Framework: Ruby on Rails
Database: PostgreSQL (shared with Next.js)
Purpose: Centralized case data management. Persists violence cases, regions, and reference data.
Based on: MSIP and cor1440_gen frameworks.
Status: Read-only from Next.js perspective. Gradual migration to @pasosdejesus/m.
User sends USDT → sivel.xyz wallet (NEXT_PUBLIC_ADDRESS)
│
▼
POST /api/donations/assign
├── Verify on-chain transfer (Viem)
├── 10% → SLEARN contract → mintAndReserve(donor, amount)
│ → 220 SLEARN per USDT minted to donor
├── 90% → RegionalDonationV2 → assignDonation()
├── Mint donor SBTs (Connector, Donor tiers)
└── Toast: SLEARN cashback + link to learn.tg
Reward Payment Flow (Documenter Scoring)
Documenter submits score (EIP-191 signed)
│
▼
POST /api/pre-alerts/:id/score
├── Verify EIP-191 signature (verifyMessage)
├── Check DOCUMENTER_WALLETS (env var → REQ/52 for SBT)
├── If score=0: reject (no payment)
└── If score=2-5:
├── Determine region from pre-alert departamento
├── withdraw(regionId, amount, rewardEscrow) on RegionalDonationV2
├── releasePayment(citizen, amount) on RewardEscrow
└── Status → paid