Slim LocalStack KMS image for kms-secp256k1-api integration tests
406
KMS Secp256k1 API - See base docker commands at https://github.com/Interchouette-ITC/kms-secp256k1-api
A high-performance custodial software wallet middleware for secure blockchain key operations.
Rust-based API service that provides key management, signing, and verification using secp256k1. Supports multiple blockchains including Ethereum, Cosmos, and Casper.
This service is designed to run securely inside Docker and can connect to cloud KMS providers like AWS KMS.
Size-optimized multi-stage build → gcr.io/distroless/cc-debian13 (Debian 13 / trixie family; no perl/apt/shell).
| Tag | Meaning |
|---|---|
:dev | Development image (Actions “CI/CD Image dev” or local make docker-build-dev) |
:latest | Stable release image (GitHub Release workflow) |
:X.Y.Z | Versioned release matching Cargo.toml (GitHub Release tag vX.Y.Z) |
Also published to:
interchouette/kms-secp256k1-apighcr.io/groussac/kms-secp256k1-apighcr.io/interchouette-itc/kms-secp256k1-apiAny Hub gregoshop/… name for this product is a deprecated mirror and is no longer published.
MCP sidecar (agents / Cursor — separate image):
interchouette/kms-secp256k1-api-mcpghcr.io/groussac/kms-secp256k1-api-mcpghcr.io/interchouette-itc/kms-secp256k1-api-mcp:dev, :latest, :X.Y.Z (same cadence; see https://github.com/Interchouette-ITC/kms-secp256k1-api/blob/dev/docs/mcp.md)Publish:
:dev → GitHub Actions → CI/CD Image dev (workflow_dispatch):X.Y.Z + :latest → GitHub Release tag vX.Y.Z (must equal Cargo.toml; see make version-show):dev / :X.Y.Z+:latest → CI/CD MCP Image workflows + GitHub ReleaseA fast and secure Rust-based API service that acts as a custodial wallet for blockchain apps. It enables cryptographic transactions (generation, signing, listing, deletion) via AWS KMS using the secp256k1 elliptic curve, while keeping private keys secure.
/createKey, /deleteKey, /listKeys, /signTransaction, /signTransactionHash, /verifySignature.[Your App] → [API Layer (this service)] → [AWS KMS (HSM secp256k1)] → [Signed Transactions] → [Blockchain Network]
The API abstracts cryptographic details, presenting your app with a secure and simple interface.
Endpoints:
POST /createKey - create a new keypair
POST /signTransactionHash - sign a hex transaction hash (query param: keys)
POST /signTransaction - sign a JSON transaction (query param: keys)
GET /verifySignature - verify signatures (optional via KMS)
GET /listKeys - list keys (can be disabled)
DELETE /deleteKey - delete a key (can be disabled)
GET / - simple hello/health
OpenAPI / Swagger UI:
Swagger UI: /api on http://localhost:<APP_PORT>/api
OpenAPI JSON: /api-doc/openapi.json on http://localhost:<APP_PORT>/api-doc/openapi.json
Feature flags via env:
Port:
Ideal for:
/deleteKey, /listKeys) can be disabled at runtime for extra safetycurl http://localhost:4000/
curl -X POST http://localhost:4000/createKey
curl -X POST "http://localhost:4000/signTransactionHash?keys=<key1>&keys=<key2>" \
-H "Content-Type: text/plain" \
-d "0x..."
curl -X POST "http://localhost:4000/signTransaction?keys=<key1>&keys=<key2>" \
-H "Content-Type: application/json" \
-d '{"field":"value"}'
curl -X GET "http://localhost:4000/verifySignature?key=<key>&transaction_hash=<hex>&signature=<sig>&via_kms=<true|false>"
curl -X GET http://localhost:4000/listKeys
curl -X DELETE "http://localhost:4000/deleteKey?key=<address_or_pubkey>"
docker build -t interchouette/kms-secp256k1-api:latest .
docker run --rm -it \
-p 4001:4001 \
-e TESTING_MODE=true \
interchouette/kms-secp256k1-api:latest
docker run --rm -it \
-p 4000:4000 \
--env-file .env \
interchouette/kms-secp256k1-api:latest
Run in test mode (no real chain interaction; useful for integration and local dev). Adjust the env values as needed.
docker run --rm -it \
-p 4001:4001 \
-e APP_PORT=4001 \
-e TESTING_MODE=true \
-e BLOCKCHAIN_MODE=casper \
-e DELETE_MODE=true \
-e LIST_MODE=true \
# ...
# or add env file
--env-file .env.test \
interchouette/kms-secp256k1-api:latest
Run in production mode (example: port 4000). If you use AWS KMS, set AWS creds/region and set AWS_MODE=true.
docker run --rm -it \
-p 4000:4000 \
--env-file .env \
interchouette/kms-secp256k1-api:latest
Test compose (maps 4001:4001 and loads .env.test):
services:
kms-secp256k1-api:
container_name: kms-secp256k1-api-test
image: interchouette/kms-secp256k1-api:latest
env_file: - .env.test
ports: - "4001:4001"
Prod compose (maps 4000:4000 and loads .env):
services:
kms-secp256k1-api:
container_name: kms-secp256k1-api
image: interchouette/kms-secp256k1-api:latest
env_file: - .env
ports: - "4000:4000"
Environment variables can be set in .env file
| Variable | Description | Default |
|---|---|---|
| TESTING_MODE | Enable test keys (mocked, for dev only) | true |
| AWS_REGION | AWS region | none |
| KMS_CREATE_ID | AWS IAM create key | none |
| KMS_CREATE_KEY | AWS IAM Create key | none |
...
Core configuration:
4001 for test, 4000 for prod)1cosmoshttp://localhost:1317/cosmos/auth/v1beta1/accounts/testingKMS key routing (used by your backend/KMS integration):
Example of .env (production) file:
APP_PORT=4000
TESTING_MODE=false
BLOCKCHAIN_MODE=casper
AWS_REGION=eu-west-3
DELETE_MODE=false
LIST_MODE=true
KMS_CREATE_ID=your_IAM_User
KMS_CREATE_KEY=your_IAM_Key
KMS_SIGN_ID=your_IAM_User
KMS_SIGN_KEY=your_IAM_Key
KMS_DELETE_ID=your_IAM_User
KMS_DELETE_KEY=your_IAM_Key
KMS_LIST_ID=your_IAM_User
KMS_LIST_KEY=your_IAM_Key
git clone https://github.com/Interchouette-ITC/kms-secp256k1-api.git
cd kms-secp256k1-api
cargo build
# default Cargo feature = casper only (faster). Full multi-chain:
# cargo build --no-default-features --features all
# Mocks (default, no Docker; --features all)
make test
# equivalent: cargo test --no-default-features --features all -- --nocapture
# Real LocalStack KMS (builds/starts kms-localstack, then runs integration tests)
make test-localstack
Chain Cargo features: casper, ethereum, cosmos, or all. Docker images always build with --features all so BLOCKCHAIN_MODE works for every chain. Fast single-chain local builds: make build FEATURES=casper or plain cargo build.
Slim LocalStack KMS image for integration tests (make test-localstack). Base: localstack/localstack:4.14.0.
| Tag | Meaning |
|---|---|
:dev | Development image (Actions “CI/CD LocalStack Image dev” or local make docker-build-localstack-dev) |
:latest | Stable release image (GitHub Release workflow) |
:X.Y.Z | Versioned release matching Cargo.toml (GitHub Release tag vX.Y.Z) |
Published to:
interchouette/kms-localstackghcr.io/groussac/kms-localstackghcr.io/interchouette-itc/kms-localstackPublish:
:dev → GitHub Actions → CI/CD LocalStack Image dev (workflow_dispatch):X.Y.Z + :latest → GitHub Release (same workflow as the API image)make docker-build-localstack
make docker-run-localstack # :4566
make docker-stop-localstack
You can use the provided Makefile for common tasks:
| Command | Description |
|---|---|
make build | Build with FEATURES (default all) |
make build FEATURES=casper | Fast single-chain build |
make test | Mock-backed tests (KMS_TEST_BACKEND=mock, --features all) |
make test-localstack | Integration tests against LocalStack KMS |
make lint | Run Clippy linter with strict rules |
make check-lint | Auto-fix Clippy lints where possible |
make docker-build | Build Docker image (Hub tags :latest + :<version>) |
make docker-build-dev | Build and tag :dev (Hub + GHCR names) |
make docker-build-localstack | Build slim LocalStack KMS image |
make docker-build-no-cache | Build Docker image without cache |
make docker-run-test | Run Docker Compose test environment (maps port 4001) |
make docker-run-localstack | Start LocalStack on port 4566 |
make docker-stop-localstack | Stop LocalStack compose |
make docker-run | Run Docker Compose production environment (maps port 4000) |
make docker-stop | Stop the production container |
make version-show | Print Cargo.toml version + suggested GitHub Release tag |
Build and run locally:
make build
make test
make docker-build
make docker-run-test
MIT License. Free to use and modify.
Content type
Image
Digest
sha256:0fb37e9b7…
Size
436.2 MB
Last updated
5 days ago
docker pull interchouette/kms-localstack