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
| Contract | Purpose |
|---|---|
SSIRegistry.sol | Aggregate registry implementing credential, schema, consent, DID, role, and metadata operations. |
CredentialRegistry.sol | Registers credential hashes, revokes credentials, and exposes registered/revoked checks. |
SchemaRegistry.sol | Registers schema hashes, updates schema versions, and exposes schema lookups. |
ConsentRegistry.sol | Grants, revokes, validates, and reads consent records keyed by holder, verifier, and purpose. |
AccessControl.sol | Defines SphyreAccessControl roles for admin, issuer, holder, verifier, and relayer accounts. |
ERC2771Context.sol | Trusted-forwarder context helper for meta-transaction sender resolution. |
MinimalForwarder.sol | EIP-712 style forwarder with nonce, signature verification, and execution support. |
SSIRegistryFactory.sol | Creates new SSIRegistry instances and lists deployed registries. |
ISSIRegistry.sol | Interface covering credential, schema, and consent registry operations. |
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.