Broadcasting

How to format and publish your Attestations to a Fide Registry.

This guide covers how to correctly format and structure your local files before pushing to a Fide Registry.

Protocol Context

Formatting with the SDK

Don't construct JSONL strings manually. Use formatAttestationForJSONL to ensure the correct schema.

1. Format the Attestation

Take your signed Attestation and the original Statements.

import { formatAttestationForJSONL } from '@fide.work/fcp';

// This function serializes the attestation AND its payload statements
// into the compact JSONL format required by indexers.
const jsonlLine = formatAttestationForJSONL(
  attestation,   // From createAttestation()
  statements     // The original array of statements
);

2. Determine the path

Generate the correct path and filename based on the current time.

import { generateRegistryPath, generateJSONLFilename } from '@fide.work/fcp';
import fs from 'fs';
import path from 'path';

const now = new Date();
const registryPath = generateRegistryPath(now); // e.g., "2024/01/15"
const filename = generateJSONLFilename(now, 1); // e.g., "2024-01-15-1400-1.jsonl"

3. Write to Disk

Append the JSONL line to the file. Never overwrite existing lines!

const fullPath = path.join('attestations', registryPath, filename);

// Ensure directory exists
fs.mkdirSync(path.dirname(fullPath), { recursive: true });

// Append line
fs.appendFileSync(fullPath, JSON.stringify(jsonlLine) + '\n');

Publishing (Discovery)

Once you have written the files:

  1. Commit & Push: Push the attestations/ folder to your public Git repository.
  2. Add Topic: Add the topic fide-attestation-registry to your GitHub repository settings.
    • This signals to public Indexers (like Fide scan) to begin ingesting your data.

Rollover Rules

  • Size Limit: Rotate to a new file (increment sequence number) if the file exceeds 50MB.
  • Time Window: Rotate (reset sequence to 1) when the HHmm window changes (every hour, or day, depending on volume).

See Protocol: Broadcasting for full spec details.

On this page