| Crates.io | ecash-server |
| lib.rs | ecash-server |
| version | 0.1.0 |
| created_at | 2025-12-07 00:21:45.268483+00 |
| updated_at | 2025-12-07 00:21:45.268483+00 |
| description | REST API server for eCash blind signature protocol |
| homepage | https://chronocoders.github.io/ecash-protocol |
| repository | https://github.com/ChronoCoders/ecash-protocol |
| max_upload_size | |
| id | 1970943 |
| size | 99,800 |
Production-grade backend API server implementing the eCash blind signature protocol.
# Install PostgreSQL
sudo apt-get install postgresql postgresql-contrib
# Create database and user
sudo -u postgres psql
CREATE DATABASE ecash_db;
CREATE USER ecash_user WITH PASSWORD 'ecash_password_2024';
GRANT ALL PRIVILEGES ON DATABASE ecash_db TO ecash_user;
\q
# Run schema
psql -U ecash_user -d ecash_db -f schema.sql
# Install Redis
sudo apt-get install redis-server
# Set password in /etc/redis/redis.conf
requirepass redis_password_2024
# Restart Redis
sudo systemctl restart redis-server
Edit .env file:
# Server
SERVER_HOST=0.0.0.0
SERVER_PORT=8080
# PostgreSQL
DATABASE_URL=postgresql://ecash_user:ecash_password_2024@localhost:5432/ecash_db
DATABASE_MAX_CONNECTIONS=10
# Redis
REDIS_URL=redis://:redis_password_2024@localhost:6379
REDIS_MAX_CONNECTIONS=10
# Institution
INSTITUTION_ID=inst_primary
KEY_ID=key_001
TOKEN_EXPIRY_DAYS=90
DENOMINATIONS=10,50,100,500,1000
# Logging
RUST_LOG=info,ecash_server=debug
# Build
cargo build --release
# Run
cargo run --release
# Or run binary
./target/release/ecash-server
GET /health
GET /api/v1/keys
POST /api/v1/withdraw
Content-Type: application/json
{
"amount": 100,
"denomination": 50,
"blinded_tokens": [...]
}
POST /api/v1/redeem
Content-Type: application/json
{
"tokens": [...],
"merchant_id": "merchant_123"
}
POST /api/v1/verify
Content-Type: application/json
{
"token": {...}
}
# Unit tests
cargo test
# Integration tests
cargo test --test '*'
# Health check
curl http://localhost:8080/health
# Get public key
curl http://localhost:8080/api/v1/keys
Target metrics (single node):
Metrics exposed at /metrics (TODO):
See deployment/ directory for:
See LICENSE file in root directory.