calculateStatementFideId
Calculate a Fide ID for a Statement from its RDF triple components. Creates a statement Fide ID by hashing the reference identifier: concatenation of subject, property, and object Fide IDs in that order, separated by ASCII `|`. No whitespace. This helper always returns the self-referential Statement form (Entity Type/Reference Type = `0000`).
Node Runtime Required
Parameters
Returns
Prop
Type
import { calculateStatementFideId } from '@fide-work/context-protocol';
const result = await calculateStatementFideId(
'did:fide:0x10205fcbdc6d73bcfcd2c73eb4795c2f02f1d1c1',
'did:fide:0x312047e49369039d57063d0535a246065fbf9c9e',
'did:fide:0x1020f200f70f531f0f9cce26e9f4bf0bfa5f15d6',
);Related Constants
Statement
Complete statement object with all required fields **Important**: Both Fide IDs and reference identifiers are required because: - Fide IDs are one-way hashes - cannot be reversed to get reference identifiers - Protocol specification requires both fields - Indexers need reference identifiers for lookup tables and human-readable display - Enables mapping back to human-readable identifiers for debugging and display
export const Statement: anyType Definitions
type FideIdCalculationOptions
Options for Fide ID calculation helpers. Reserved for forward-compatible toggles without changing function signatures.
FideIdCalculationOptionsProperties
Prop
Type
calculateFideId
Core primitive: calculate a Fide ID from type codes and reference identifier. Deterministic SHA-256 hash of the reference identifier (UTF-8), then constructs `did:fide:0x` + 2 hex (entity type) + 2 hex (reference type) + first 36 hex of hash = 40 hex total.
getFideEntityTypeSpecByCode
Look up the definition for a single Fide entity type by hexadecimal code.