@flowhash/nftc-core
v0.1.0
Published
NFTC Protocol core domain models and validation for W3C Verifiable Credentials
Maintainers
Readme
@flowhash/nftc-core
Core TypeScript library for the NFTC Protocol - W3C Verifiable Credentials for Real-World Assets
Overview
@flowhash/nftc-core provides the foundational domain models, validation, and cryptographic utilities for building applications on the NFTC Protocol. It implements W3C Verifiable Credentials for real-world asset tokenization with compliance features.
Installation
npm install @flowhash/nftc-coreQuick Start
import { RightToUse } from '@flowhash/nftc-core';
const rtu = RightToUse.create({
issuer: 'did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH',
holder: 'did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK',
resourceId: 'resource:vehicle:tesla-model-3-2024',
resourceType: 'vehicle',
validFrom: new Date('2025-01-01'),
validUntil: new Date('2025-12-31'),
});
const { valid, errors } = rtu.checkInvariants();
console.log('Valid:', valid);
console.log('ID:', rtu.getId());Features
- ✅ W3C Verifiable Credentials Data Model 1.1
- ✅ 4 Credential Types (RTU, POU, POC, SR)
- ✅ Ed25519 Signatures (@noble/ed25519)
- ✅ DID Resolution (did:key, did:web)
- ✅ Invariant Validation
- ✅ Merkle Proofs for Anchoring
- ✅ 98.57% Test Coverage
- ✅ Full TypeScript Support
License
Apache-2.0 © NFTC Protocol Core Team
