NFT-backed licensing and attribution orchestration for Lilith content. The service coordinates policy composition, compliance validation, metadata assembly, artifact storage, NFT minting, attribution telemetry, royalty distribution, and revocation audit trails.
Pipeline#
- Content registry – fetches canonical content metadata and creator credits.
- Policy composer + validator – generates license terms and enforces creator/compliance guardrails.
- Metadata builder – assembles on-chain/off-chain metadata packages for the license NFT.
- Artifact storage – persists policy, metadata, and attribution manifests (e.g., IPFS).
- NFT minter – mints the license token on the configured chain.
- License ledger – records issuance, attribution usage, distributions, and revocations.
- Attribution service – indexes license attribution and provides usage summaries.
- Distribution engine – executes royalty payouts with attribution context.
- Revocation orchestrator – handles compliance-triggered license shutdowns and audit logs.
- Analytics reporter – emits telemetry for issuance, attribution, payouts, and revocations.
Usage#
ts
import { createContentLicensingService } from './service';
const service = createContentLicensingService({
contentRegistry,
policyComposer,
policyValidator,
metadataBuilder,
artifactStorage,
nftMinter,
licenseLedger,
analyticsReporter,
attributionService,
distributionEngine,
revocationOrchestrator,
});
const issuance = await service.issueLicense({
contentId: 'teaching-emerald-light',
licensee: { address: '0xlicensee', name: 'Lumina Studios' },
usage: {
channels: ['web', 'mobile'],
territories: ['global'],
expiresAtIso: '2026-01-01T00:00:00.000Z',
},
financials: { upfrontFee: '1.5', currency: 'ETH', royaltyBps: 1200 },
distributionPlan: { reportingIntervalDays: 30, auditRights: true },
chainId: 137,
});
await service.recordAttributionEvent({
licenseId: issuance.licenseId,
contentId: 'teaching-emerald-light',
channel: 'web',
impressions: 500,
metadata: { region: 'NA' },
});
await service.distributeRoyalties({
licenseId: issuance.licenseId,
initiatedBy: 'ops-bot',
amount: '0.75',
currency: 'ETH',
trigger: 'scheduled',
periodStartIso: '2025-01-01T00:00:00.000Z',
periodEndIso: '2025-02-01T00:00:00.000Z',
});
Tests#
bash
cd apps/lilith/svc-content-licensing
npm test