ncc-02-js 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +6 -4
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -27,11 +27,12 @@ import { NCC02Resolver } from 'ncc-02-js';
27
27
 
28
28
  // Initialize with relay URLs and optional trusted CA pubkeys
29
29
  const resolver = new NCC02Resolver(['wss://relay.damus.io'], {
30
- trustedCAPubkeys: ['ca_pubkey_hex']
30
+ trustedCAPubkeys: ['npub1...'] // Trusted third-party certifiers
31
31
  });
32
32
 
33
33
  try {
34
- const service = await resolver.resolve(ownerPubkey, 'api', {
34
+ // ownerPubkey can be hex or npub
35
+ const service = await resolver.resolve(ownerPubkey, 'media', {
35
36
  requireAttestation: true,
36
37
  minLevel: 'verified' // 'self', 'verified', 'hardened'
37
38
  });
@@ -46,6 +47,7 @@ try {
46
47
  ```javascript
47
48
  import { NCC02Builder } from 'ncc-02-js';
48
49
 
50
+ // Initialize with private key (hex)
49
51
  const builder = new NCC02Builder(privateKey);
50
52
 
51
53
  // Example 1: IP-based Service
@@ -71,8 +73,8 @@ const onionEvent = builder.createServiceRecord({
71
73
  ```javascript
72
74
  const caBuilder = new NCC02Builder(caPrivateKey);
73
75
  const attestation = caBuilder.createAttestation({
74
- subjectPubkey: ownerPubkey,
75
- serviceId: 'api',
76
+ subjectPubkey: 'npub1...', // The service owner being certified
77
+ serviceId: 'media',
76
78
  serviceEventId: serviceRecordEventId,
77
79
  level: 'verified',
78
80
  validDays: 30
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ncc-02-js",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Nostr-native service discovery and trust implementation (NCC-02)",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",