@metalabel/dfos-protocol
Ed25519 signed chain primitives for cryptographic identity and verifiable content. Self-certifying DIDs, content-addressed CIDs, offline verification. The protocol operates on keys and document hashes — application semantics are a separate concern, free to evolve without protocol changes.
Install
npm install @metalabel/dfos-protocolUsage
// Chain verification
import { verifyContentChain, verifyIdentityChain } from '@metalabel/dfos-protocol/chain';
// Credentials (auth tokens + DFOS credentials)
import { createAuthToken, createDFOSCredential } from '@metalabel/dfos-protocol/credentials';
// Crypto primitives
import { createJws, dagCborCanonicalEncode, verifyJws } from '@metalabel/dfos-protocol/crypto';Subpath Exports
| Export | Description |
|---|---|
@metalabel/dfos-protocol/chain |
Identity & content chains, services, artifacts, countersigns, revocations |
@metalabel/dfos-protocol/credentials |
Auth tokens (DID-signed JWT) and DFOS credentials for authorization |
@metalabel/dfos-protocol/crypto |
Ed25519, JWS, JWT, dag-cbor, base64url, ID generation |
Specifications
| Document | Description |
|---|---|
| PROTOCOL.md | Core protocol — chains, signatures, verification, test vectors |
| DID-METHOD.md | W3C DID method specification for did:dfos |
| CONTENT-MODEL.md | Standard content schemas (post, profile) |
Examples
The examples/ directory contains deterministic reference fixtures that can be independently verified by any Ed25519 + dag-cbor implementation:
identity-genesis.json— single create operationidentity-rotation.json— genesis + key rotationidentity-delete.json— genesis + delete (terminal)content-lifecycle.json— create + update (with both documents)content-delete.json— create + deletecontent-delegated.json— creator genesis + delegated update with DFOS write credentialcredential-write.json— DFOS write credential (broad + content-narrowed)credential-read.json— DFOS read credentialidentity-services.json— genesis publishing a services set (relay locator + content/artifact anchors)
License
MIT