BioAnchorRegistry
BioAnchorRegistry is a Smart Contract for storing Poseidon commitments that bind a did:bio Decentralized Identifier to a user's genomic identity profile on the blockchain.
BioAnchorRegistry is an optional extension of the BIA system. Users who want self-sovereign identity anchoring can register a commitment on the blockchain. For those who prefer a lighter approach, the OIDC Provider can be used without blockchain.
Key Features
| Feature | Details |
|---|---|
| One Anchor Per Address | Each Ethereum address can register only one genomic commitment, creating a 1:1 binding between a wallet and a genome |
| Sybil Resistance | Uses commitmentOwner reverse mapping to prevent the same commitment from being registered by two addresses. Since each genome produces a unique Poseidon hash, this prevents a single person from creating multiple identities |
| Assurance Levels (0-3) | Specifies the trust level of genomic data verification. Trusted attesters can upgrade the level after laboratory verification |
| Revocation | Users can revoke their own anchor, for example in the case of genomic data compromise. After revocation, a new commitment can be registered |
Data Structures
BioAnchorRecord
struct BioAnchorRecord {
bytes32 commitment; // Poseidon hash of (salt || snpVector || hlaVector || mtDNA)
uint8 assuranceLevel; // Assurance level (0=none, 1=self, 2=lab, 3=multi)
uint256 registeredAt; // Block timestamp of registration
bool active; // Active status (false after revocation)
}
State Mappings
// Binds wallet address to bio-anchor record (1 anchor per 1 address)
mapping(address => BioAnchorRecord) public anchors;
// Reverse mapping from commitment hash back to owner address (Sybil prevention)
mapping(bytes32 => address) public commitmentOwner;
// Set of addresses authorized to upgrade assurance level
mapping(address => bool) public trustedAttesters;
Assurance Levels
| Level | Name | Description | Example |
|---|---|---|---|
| 0 | None | No verification | Commitment registered without evidence |
| 1 | Self-Attested | User uploads VCF themselves | User submits VCF file from a sequencing service |
| 2 | Lab-Verified | Laboratory verifies that VCF matches commitment | Trusted attester confirms results |
| 3 | Multi-Source | Two independent laboratories confirm the data | Two sequencing sources produce matching results |
Typical upgrade path: 0 -> 1 (user uploads VCF) -> 1 -> 2 (lab confirms) -> 2 -> 3 (second lab confirms)
Core Functions
Interface: Core Functions
contract BioAnchorRegistry {
// ──── Events ────
event AnchorRegistered(
address indexed account, bytes32 commitment,
uint8 assuranceLevel, uint256 timestamp
);
event AssuranceUpgraded(
address indexed account, uint8 oldLevel,
uint8 newLevel, address indexed attester
);
event AnchorRevoked(
address indexed account, bytes32 commitment, uint256 timestamp
);
// ──── Core Functions ────
function registerAnchor(bytes32 commitment, uint8 assuranceLevel) external;
function upgradeAssurance(address account, uint8 newLevel) external; // onlyAttester
function revokeAnchor() external;
// ──── View Functions ────
function verifyAnchor(address account) external view
returns (bool exists, bytes32 commitment, uint8 assuranceLevel, bool active);
function getCommitmentOwner(bytes32 commitment) external view returns (address owner);
function isAttester(address attester) external view returns (bool isTrusted);
// ──── Admin Functions ────
function addAttester(address attester) external; // onlyAdmin
function removeAttester(address attester) external; // onlyAdmin
function transferAdmin(address newAdmin) external; // onlyAdmin
}
registerAnchor
: Registers a genomic commitment as a biological identity anchor. The commitment is a Poseidon hash computed from Poseidon(salt, snpVector, hlaVector, mtDNA). The salt is stored only in the user's sovereign wallet and is never sent to the blockchain.
upgradeAssurance : Upgrades the assurance level of an existing anchor. Can only be called by trusted attesters (e.g., sequencing laboratories). The new level must always be higher than the current level.
revokeAnchor : Revokes one's own bio-anchor. Used in cases where genomic data has been compromised, or when re-registration with a new commitment (new salt) is desired. After revocation, the reverse mapping is deleted, allowing re-registration.
verifyAnchor
: The primary view function for checking an account's bio-anchor. The OIDC Provider uses this function when a relying party requests authentication for a did:bio:ever:0x... subject.
getCommitmentOwner
: Looks up the address that owns a commitment. Returns address(0) if the commitment is not registered or has been revoked.
sub: did:bio:ever:0x...bio_assurance_level: 2bio_liveness_active: trueOIDC Integration
When a relying party sends an authentication request for a did:bio:ever:0x... subject to the OIDC Provider, the system performs the following checks:
- Reads
verifyAnchor()to verify that the anchor exists and is active - Checks that the commitment matches the value stored server-side
- Verifies that the assurance level meets the relying party's requirements
For more details about the OIDC flow, see BIA Architecture.
Estimated Gas Costs
Actual costs depend on the network used.
| Operation | Gas (estimated) |
|---|---|
registerAnchor | ~65,000 |
upgradeAssurance | ~30,000 |
revokeAnchor | ~35,000 |
verifyAnchor | 0 (view function) |
See Also
- BIA Developer Quickstart — Getting started with BIA
- BIA Architecture — BIA system architecture
- Account — EDHAccount and EDHAccountRegistry