Min Calculated Fide ID

The simplest, decentralized method for resolving identity clusters.

The Min Fide ID pattern is the most common and robust way to resolve an identity cluster in a decentralized system without a global clock.

It simply states: "In a cluster of Fide IDs representing the same entity, the one with the lowest lexical hash is the Primary Fide ID."

Why Min?

  • Deterministic: Every indexer, regardless of sync order, arrives at the same result.
  • Simple: Can be implemented in a single SQL query.
  • Robust: No need for complex "first seen" logic or timestamp coordination.

Algorithm

Identify the Cluster

Find all entities connected by valid owl:sameAs links. This forms a "connected component" or cluster.

Sort by ID

List all Fide IDs in the cluster.

  • did:fide:0x15...a (Twitter)
  • did:fide:0x15...b (GitHub)
  • did:fide:0x18...c (Wallet)

Select Minimum

The ID with the lowest alphanumeric value becomes the canonical Primary Fide ID for the entire cluster.

SQL Implementation

This recursive CTE (Common Table Expression) implements the Min Fide ID logic for PostgreSQL.

-- 1. Find all trusted owl:sameAs edges
WITH RECURSIVE sameAs_edges AS (
    -- Direct links A -> B
    SELECT 
        subject_fingerprint AS node_a, 
        object_fingerprint AS node_b
    FROM fcp_statements
    WHERE predicate_raw_identifier = 'owl:sameAs'
    
    UNION
    
    -- Bidirectional links B -> A (implicitly trusted)
    SELECT 
        object_fingerprint AS node_a, 
        subject_fingerprint AS node_b
    FROM fcp_statements
    WHERE predicate_raw_identifier = 'owl:sameAs'
),

-- 2. Flood-fill to find connected components (clusters)
cluster_membership AS (
    -- Base case: every node is in its own cluster start
    SELECT node_a AS entity, node_a AS root
    FROM sameAs_edges
    
    UNION
    
    -- Recursive step: expand to neighbors
    SELECT e.node_b, c.root
    FROM sameAs_edges e
    INNER JOIN cluster_membership c ON c.entity = e.node_a
),

-- 3. Elect the Primary Fide ID (Min ID)
cluster_primary AS (
    SELECT 
        entity,
        MIN(root) OVER (PARTITION BY root) as primary_id
    FROM cluster_membership
)

-- 4. Use the Primary mapping
SELECT * FROM cluster_primary;

Trade-offs

FeatureMin Fide ID
Stability⚠️ Medium: Can "flicker" if a new, lower-hash alias is linked later.
ComplexityLow: Pure SQL, no state management.
DecentralizationHigh: Zero coordination required.

For applications requiring strict Time-Based Stability (first-seen wins), see the Genesis Statement Pattern.

On this page