Skip to main content
Attestix
Reference

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

VariableRequiredDefaultDescription
ATTESTIX_DATA_DIRNoSame directory as main.pyDirectory for JSON storage files
ATTESTIX_KEY_FILENo.signing_key.jsonPath to Ed25519 signing key file
BASE_RPC_URLFor blockchain-Base L2 RPC endpoint (e.g., https://sepolia.base.org)
BASE_WALLET_KEYFor blockchain-Private key for blockchain transactions (hex string, no 0x prefix)
EAS_CONTRACTFor blockchainSepolia defaultEthereum Attestation Service contract address
ATTESTIX_LOG_LEVELNoINFOLogging level (DEBUG, INFO, WARNING, ERROR)

Setting Environment Variables

Linux/macOS

export ATTESTIX_DATA_DIR=/var/lib/attestix
export ATTESTIX_LOG_LEVEL=DEBUG
python main.py

Windows

$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=DEBUG

Attestix 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/attestix

All 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.json

Blockchain 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_prefix

Base Mainnet

export BASE_RPC_URL=https://mainnet.base.org
export BASE_WALLET_KEY=your_private_key_hex_no_0x_prefix

Warning: The BASE_WALLET_KEY is 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.py

Connect your MCP client to the process's stdin/stdout.

Multi-Instance Setup

To share data across multiple Attestix instances (e.g., development and staging):

  1. Set ATTESTIX_DATA_DIR to a shared directory
  2. Copy .signing_key.json to the shared directory
  3. 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.py

Docker

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 attestix

Running 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-bench

This 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