Smart Contracts
Sphyre’s on-chain layer lives infortro-contract-dev/hardhat/contracts and is consumed by Fortro Engine through ABI files copied into fortro-engine/src/blockchain/abis.
Network
Target: Base Sepolia
Chain ID:
Client:
Chain ID:
84532Client:
ethers via Fortro EngineBackend Contract Client
fortro-engine/src/blockchain/client.rs binds to SSIRegistry.json and calls the aggregate registry contract.Contract Inventory
Roles
SphyreAccessControl defines these role constants:
Registry Operations
Fortro Engine Routes
The active blockchain API is implemented infortro-engine/src/api/blockchain_new.rs:
/api/blockchain-legacy remains mounted for older flows and meta-transaction helper endpoints.
Configuration
Fortro Engine reads blockchain configuration from environment variables:BLOCKCHAIN_CHAIN_ID must match the connected RPC chain. The code validates the chain ID before constructing the contract client.
Data Anchoring Model
- Credential issuance anchors
credential_hashagainst the subject DID. - Credential revocation checks and revokes the same DID/hash pair.
- Schema creation anchors schema IDs to schema hash/URI values.
- Consent grants and revocations are keyed by holder DID, verifier DID, and purpose.
- Verification flows use on-chain credential registration and revocation checks as one layer of validation.
Operational Notes
- Backend database state remains the source for rich credential metadata; contracts anchor integrity, status, role, and consent facts.
- Smart-contract calls can fail independently from MongoDB/IPFS writes. Backend handlers log blockchain failure and may continue for selected issuance and revocation flows.
- ABI files must be regenerated and copied into
fortro-engine/src/blockchain/abiswhenever Solidity function signatures change.