Skip to content

SorobanVerify/soroban-verify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” Soroban Verify

License: MIT Rust NestJS Next.js TypeScript Stellar PRs Welcome

A production-ready Soroban smart contract verification tool for the Stellar ecosystem

Soroban Verify is a complete verification platform that allows developers to verify their deployed Soroban contracts, similar to Sourcify on Ethereum. It provides a CLI tool, REST API, web dashboard, and automated indexer.


πŸ“‹ Table of Contents


🎯 Overview

Soroban Verify is a decentralized verification platform for Stellar Soroban smart contracts. It solves a critical gap in the ecosystem: there is currently no standardized way to verify that a deployed contract's bytecode matches its public source code.

This project provides:

Component Description
CLI Tool Developers run soroban verify to upload and verify their contracts
Verification API REST API for block explorers and wallets to query verification status
Web Dashboard Browse and search verified contracts
Automated Indexer Scans the blockchain and automatically detects new contracts

πŸ”₯ Why This Project

Problem Solution
No contract verification on Stellar First complete verification tool
Users can't trust contracts βœ… Verified badge shows trust
Explorers lack metadata API provides source code and ABIs
Developers have no standard CLI tool standardizes the process

✨ Features

Feature Description
CLI Verification One-command verification: soroban verify
Multi-platform CLI Works on Windows, Mac, Linux
WASM Hash Matching Compares local WASM with on-chain bytecode
Source Code Storage Stores source code and metadata permanently
Verification API REST endpoints for explorers and wallets
Web Dashboard Browse and search verified contracts
Automated Indexer Scans Stellar for new contract deployments
GitHub Actions CI Automated testing and deployment
Docker Support Easy deployment with docker-compose

πŸ›  Tech Stack

Component Technology Version
CLI Tool Rust 1.70+
CLI Framework Clap 4.4
WASM Processing wasmparser 0.118
Backend API NestJS 10.x
Backend Language TypeScript 5.x
Database PostgreSQL 15.x
ORM TypeORM 0.3.x
Frontend Next.js 14.2
Frontend Language TypeScript 5.x
Styling Tailwind CSS 3.4
Indexer Node.js 20.x
Container Docker -
CI/CD GitHub Actions -

πŸ— Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Developer Workflow                                                         β”‚
β”‚                                                                             β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                     β”‚
β”‚ β”‚ Developer    │──▢│ soroban      │──▢│ Soroban      β”‚                     β”‚
β”‚ β”‚ (Rust)       β”‚   β”‚ verify       β”‚   β”‚ Verify API   β”‚                     β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                     β”‚
β”‚                                                                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                      β”‚
                                      β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Soroban Verify Platform                                                    β”‚
β”‚                                                                             β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                     β”‚
β”‚ β”‚ CLI Tool     β”‚   β”‚ REST API     β”‚   β”‚ Dashboard    β”‚                     β”‚
β”‚ β”‚ (Rust)       │──▢│ (NestJS)     │──▢│ (Next.js)    β”‚                     β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                     β”‚
β”‚         β”‚                  β”‚                  β”‚                             β”‚
β”‚         β–Ό                  β–Ό                  β–Ό                             β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                β”‚
β”‚ β”‚ PostgreSQL Database                                     β”‚                β”‚
β”‚ β”‚ (Contracts, Verifications, Users)                       β”‚                β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                β”‚
β”‚                                                                             β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                β”‚
β”‚ β”‚ Automated Indexer                                       β”‚                β”‚
β”‚ β”‚ (Scans Stellar for new contract deploys)                β”‚                β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                β”‚
β”‚                                                                             β”‚
β”‚ β–Ό                                                                           β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                β”‚
β”‚ β”‚ Stellar Blockchain                                      β”‚                β”‚
β”‚ β”‚ (Soroban Contract Deployments)                          β”‚                β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                β”‚
β”‚                                                                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                      β”‚
                                      β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ End Users                                                                   β”‚
β”‚                                                                             β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                     β”‚
β”‚ β”‚ Block        │──▢│ Wallets      │──▢│ Developers   β”‚                     β”‚
β”‚ β”‚ Explorers    β”‚   β”‚ (Freighter)  β”‚   β”‚ (Checking)   β”‚                     β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                     β”‚
β”‚                                                                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“ Project Structure

soroban-verify/
β”œβ”€β”€ cli/ # Rust CLI Tool (13 files)
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ main.rs # Entry point
β”‚   β”‚   β”œβ”€β”€ commands/
β”‚   β”‚   β”‚   β”œβ”€β”€ mod.rs # Command module
β”‚   β”‚   β”‚   β”œβ”€β”€ verify.rs # Verify command logic
β”‚   β”‚   β”‚   β”œβ”€β”€ publish.rs # Publish command
β”‚   β”‚   β”‚   β”œβ”€β”€ status.rs # Check verification status
β”‚   β”‚   β”‚   └── list.rs # List verified contracts
β”‚   β”‚   β”œβ”€β”€ config.rs # Configuration management
β”‚   β”‚   β”œβ”€β”€ api.rs # API client for backend
β”‚   β”‚   β”œβ”€β”€ wasm.rs # WASM compilation & hashing
β”‚   β”‚   β”œβ”€β”€ error.rs # Error handling
β”‚   β”‚   └── utils.rs # Utility functions
β”‚   β”œβ”€β”€ tests/
β”‚   β”‚   └── integration_test.rs # Integration tests
β”‚   └── Cargo.toml # Rust dependencies
β”‚
β”œβ”€β”€ api/ # NestJS Backend (28 files)
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ main.ts # Application entry point
β”‚   β”‚   β”œβ”€β”€ app.module.ts # Root module
β”‚   β”‚   β”œβ”€β”€ modules/
β”‚   β”‚   β”‚   β”œβ”€β”€ contracts/ # Contract management
β”‚   β”‚   β”‚   β”œβ”€β”€ verification/ # Verification logic
β”‚   β”‚   β”‚   β”œβ”€β”€ users/ # User management
β”‚   β”‚   β”‚   β”œβ”€β”€ auth/ # Authentication
β”‚   β”‚   β”‚   β”œβ”€β”€ admin/ # Admin panel
β”‚   β”‚   β”‚   └── stats/ # Statistics
β”‚   β”‚   β”œβ”€β”€ common/ # Shared utilities
β”‚   β”‚   β”œβ”€β”€ config/
β”‚   β”‚   β”œβ”€β”€ database/
β”‚   β”‚   └── workers/
β”‚   β”œβ”€β”€ test/
β”‚   β”œβ”€β”€ package.json
β”‚   └── Dockerfile
β”‚
β”œβ”€β”€ frontend/ # Next.js Dashboard (18 files)
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   β”œβ”€β”€ contexts/
β”‚   β”‚   └── styles/
β”‚   β”œβ”€β”€ package.json
β”‚   └── Dockerfile
β”‚
β”œβ”€β”€ indexer/ # Automated Indexer
β”‚   β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ package.json
β”‚   └── tsconfig.json
β”‚
β”œβ”€β”€ .github/
β”‚   └── workflows/
β”‚
β”œβ”€β”€ docker-compose.yml
β”œβ”€β”€ .gitignore
β”œβ”€β”€ LICENSE
└── README.md

πŸš€ Quick Start

Prerequisites

Requirement Version Installation
Node.js 18+ https://nodejs.org
Rust 1.70+ https://rustup.rs
PostgreSQL 15+ https://postgresql.org
Docker Latest https://docker.com

Using Docker (Recommended)

# Clone the repository
git clone https://github.com/SorobanVerify/soroban-verify.git
cd soroban-verify

# Start all services
docker-compose up -d

# Services will be available at:
# - API: http://localhost:3001
# - Frontend: http://localhost:3000
# - PostgreSQL: localhost:5432

Manual Installation

# Backend
cd api
npm install
cp .env.example .env
npm run start:dev

# Frontend (new terminal)
cd frontend
npm install
cp .env.example .env.local
npm run dev

# Indexer (new terminal)
cd indexer
npm install
npm run start:dev

πŸ”§ CLI Tool

Installation

# From source
cd cli
cargo install --path .

# Or via cargo
cargo install soroban-verify

Usage

# Verify a contract
soroban verify --contract-id <CONTRACT_ID> --path ./contract

# Check verification status
soroban status --contract-id <CONTRACT_ID>

# List all verified contracts
soroban list

# Publish source code only
soroban publish --contract-id <CONTRACT_ID> --path ./contract

πŸ“‘ API Documentation

Base URL

http://localhost:3001/api/v1

Endpoints

Method Endpoint Description
POST /contracts Create contract entry
GET /contracts List contracts
GET /contracts/:id Get contract details
POST /verification/verify Submit for verification
GET /verification/status/:id Check verification status
GET /verification/contract/:contractId Get verification for contract
POST /users Create user
GET /users/me Get current user
POST /auth/login Login
POST /auth/register Register
GET /stats Platform statistics
GET /health Health check

Example Request

# Verify a contract
curl -X POST http://localhost:3001/api/v1/verification/verify \
  -H "Content-Type: application/json" \
  -d '{
    "contractId": "CCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "sourceCode": "base64_encoded_source",
    "wasmHash": "0x1234..."
  }'

πŸ’» Frontend Dashboard

Pages

Page Route Description
Home / Landing page
Contract Details /contracts/:id View verified contract
Verify /verify Submit contract for verification
Dashboard /dashboard User dashboard
Admin /admin Admin panel

Features

  • πŸ” Search verified contracts
  • βœ… Verification status badges
  • πŸ“„ Source code viewer
  • πŸ“Š Statistics dashboard
  • πŸ‘€ User authentication
  • πŸ›‘οΈ Admin moderation

πŸ’» Development

Backend Scripts

Command Description
npm run start:dev Start with hot reload
npm run build Build for production
npm run start:prod Run production build
npm run lint Run ESLint
npm run format Format with Prettier
npm run test Run unit tests
npm run test:cov Run tests with coverage
npm run test:e2e Run e2e tests

Frontend Scripts

Command Description
npm run dev Start development server
npm run build Build for production
npm run start Run production build
npm run lint Run ESLint

CLI Development

Command Description
cargo build Build the CLI
cargo run -- verify --contract-id Run with args
cargo test Run tests
cargo fmt Format code
cargo clippy Run linter

πŸ§ͺ Testing

Backend Tests

cd api
npm run test
npm run test:cov
npm run test:e2e

CLI Tests

cd cli
cargo test
cargo test -- --nocapture

Frontend Tests

cd frontend
npm run test
npm run test:e2e

🐳 Docker

Build Images

# Build all services
docker-compose build

# Build specific service
docker build -t soroban-verify-api ./api
docker build -t soroban-verify-frontend ./frontend

Run with Docker Compose

# Start all services
docker-compose up -d

# View logs
docker-compose logs -f

# Stop services
docker-compose down

Docker Compose Configuration

version: '3.8'

services:
  postgres:
    image: postgres:15
    environment:
      POSTGRES_DB: soroban_verify
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
    ports:
      - "5432:5432"
    volumes:
      - postgres_data:/var/lib/postgresql/data

  api:
    build: ./api
    ports:
      - "3001:3001"
    depends_on:
      - postgres
    environment:
      DB_HOST: postgres
      DB_PORT: 5432
      DB_USERNAME: postgres
      DB_PASSWORD: postgres
      DB_DATABASE: soroban_verify

  frontend:
    build: ./frontend
    ports:
      - "3000:3000"
    depends_on:
      - api

volumes:
  postgres_data:

🚒 Deployment

Deploy to Production

# Build the application
docker-compose -f docker-compose.prod.yml build

# Push images to registry
docker push soroban-verify-api:latest
docker push soroban-verify-frontend:latest

# Deploy with environment variables
docker-compose -f docker-compose.prod.yml up -d

Environment Variables

Variable Description Default
NODE_ENV Environment development
PORT API port 3001
DB_HOST Database host localhost
DB_PORT Database port 5432
DB_USERNAME Database user postgres
DB_PASSWORD Database password postgres
DB_DATABASE Database name soroban_verify
JWT_SECRET JWT signing secret -
STELLAR_NETWORK Stellar network testnet

🀝 Contributing

We welcome contributions! Please read our CONTRIBUTING.md for guidelines.

Commit Convention

Type Description
feat New feature
fix Bug fix
docs Documentation
style Code style
refactor Code refactor
test Testing
chore Maintenance

Pull Request Process

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests
  5. Submit a pull request

πŸ”’ Security

Reporting Vulnerabilities

Please DO NOT file public issues for security vulnerabilities.

Email: security@sorobanverify.com

Include:

  • Description of the vulnerability
  • Steps to reproduce
  • Potential impact

Security Best Practices

  • Never commit .env files
  • Always use environment variables for secrets
  • Validate all user inputs
  • Use HTTPS in production
  • Regular security audits

πŸ†˜ Support

Channel Link
GitHub Issues Open an issue
Discord Join Discord
Email team@sorobanverify.com

πŸ“„ License

MIT Β© Soroban Verify

Built on Stellar Soroban | Making Smart Contracts Trustable πŸ”

About

A Soroban smart contract verification tool for Stellar (like Sourcify for Ethereum)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors