Configuration
Attestix configuration via environment variables, storage setup, signing key management, and MCP client configuration.
Configuration
Attestix is configured via environment variables. No config file is needed for basic usage.
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
ATTESTIX_DATA_DIR | No | Same directory as main.py | Directory for JSON storage files |
ATTESTIX_KEY_FILE | No | .signing_key.json | Path to Ed25519 signing key file |
BASE_RPC_URL | For blockchain | - | Base L2 RPC endpoint (e.g., https://sepolia.base.org) |
BASE_WALLET_KEY | For blockchain | - | Private key for blockchain transactions (hex string, no 0x prefix) |
EAS_CONTRACT | For blockchain | Sepolia default | Ethereum Attestation Service contract address |
ATTESTIX_LOG_LEVEL | No | INFO | Logging level (DEBUG, INFO, WARNING, ERROR) |
Setting Environment Variables
Linux/macOS
export ATTESTIX_DATA_DIR=/var/lib/attestix
export ATTESTIX_LOG_LEVEL=DEBUG
python main.pyWindows
$env:ATTESTIX_DATA_DIR = "C:\attestix-data"
$env:ATTESTIX_LOG_LEVEL = "DEBUG"
python main.py.env file
Create a .env file in the Attestix directory:
ATTESTIX_DATA_DIR=/var/lib/attestix
ATTESTIX_LOG_LEVEL=DEBUGAttestix uses python-dotenv and loads .env automatically.
Storage Configuration
By default, Attestix stores all data in JSON files alongside main.py:
attestix/
main.py
identities.json # Created on first identity creation
credentials.json # Created on first credential issuance
compliance.json # Created on first compliance profile
provenance.json # Created on first provenance record
reputation.json # Created on first interaction recording
delegations.json # Created on first delegation
.signing_key.json # Created on first run (DO NOT SHARE)
.keypairs.json # Created on first DID key generation (DO NOT SHARE)To use a custom directory:
export ATTESTIX_DATA_DIR=/var/lib/attestixAll JSON files will be created in that directory instead.
Signing Key Management
On first run, Attestix generates an Ed25519 keypair and stores it in .signing_key.json. This key is used to sign every UAIT, credential, compliance record, and audit entry.
Important: Back up .signing_key.json securely. If you lose it, you cannot create new artifacts that chain to the same DID.
To use a specific key file:
export ATTESTIX_KEY_FILE=/secure/path/attestix-key.jsonBlockchain Configuration
Blockchain anchoring is optional. To enable it, you need a funded wallet on Base L2.
Base Sepolia (Testnet)
export BASE_RPC_URL=https://sepolia.base.org
export BASE_WALLET_KEY=your_private_key_hex_no_0x_prefixBase Mainnet
export BASE_RPC_URL=https://mainnet.base.org
export BASE_WALLET_KEY=your_private_key_hex_no_0x_prefixWarning: The
BASE_WALLET_KEYis a private key that controls funds. Never commit it to version control. Use environment variables or a secrets manager.
Gas Estimation
Use estimate_anchor_cost to check costs before anchoring:
estimate_anchor_cost(artifact_type="identity")Returns estimated gas in ETH at current gas prices.
MCP Client Configuration
Claude Code
Add to ~/.claude.json (macOS/Linux) or %USERPROFILE%\.claude.json (Windows):
{
"mcpServers": {
"attestix": {
"type": "stdio",
"command": "python",
"args": ["/absolute/path/to/attestix/main.py"]
}
}
}Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"attestix": {
"command": "python",
"args": ["/absolute/path/to/attestix/main.py"]
}
}
}Any MCP Client
Attestix communicates over stdio using the MCP protocol. Start the server with:
python main.pyConnect your MCP client to the process's stdin/stdout.
Multi-Instance Setup
To share data across multiple Attestix instances (e.g., development and staging):
- Set
ATTESTIX_DATA_DIRto a shared directory - Copy
.signing_key.jsonto the shared directory - Each instance reads/writes the same JSON files with file locking
# Instance 1
export ATTESTIX_DATA_DIR=/shared/attestix
python main.py
# Instance 2 (different process or machine with shared filesystem)
export ATTESTIX_DATA_DIR=/shared/attestix
python main.pyDocker
Running Attestix
FROM python:3.12-slim
WORKDIR /app
COPY . .
RUN pip install --no-cache-dir -r requirements.txt
ENV ATTESTIX_DATA_DIR=/data
VOLUME /data
CMD ["python", "main.py"]docker build -t attestix .
docker run -v attestix-data:/data attestixRunning the Test Suite
The project includes Dockerfile.test which runs all 284 tests (unit, e2e, and conformance benchmarks) in a clean container:
docker build -f Dockerfile.test -t attestix-bench . && docker run --rm attestix-benchThis validates:
- 193 unit and end-to-end tests
- 91 conformance benchmarks (RFC 8032, W3C VC, W3C DID, UCAN, MCP, performance)
- Performance thresholds for all cryptographic and service operations