nostr-attestations 2.4.0 → 2.5.1
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.
- package/README.md +24 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# nostr-attestations
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/nostr-attestations)
|
|
4
|
+
[](https://github.com/forgesworn/nostr-attestations/actions/workflows/ci.yml)
|
|
5
|
+
|
|
6
|
+
One Nostr event kind for all attestations -- credentials, endorsements, vouches, provenance, licensing, and trust. Supports both direct attestation and assertion-first patterns within a single kind.
|
|
4
7
|
|
|
5
8
|
**Nostr:** [`npub1mgvlrnf5hm9yf0n5mf9nqmvarhvxkc6remu5ec3vf8r0txqkuk7su0e7q2`](https://njump.me/npub1mgvlrnf5hm9yf0n5mf9nqmvarhvxkc6remu5ec3vf8r0txqkuk7su0e7q2)
|
|
6
9
|
|
|
@@ -108,7 +111,8 @@ const revoked = isRevoked(event) // true if ["status", "revoked"] tag present
|
|
|
108
111
|
```typescript
|
|
109
112
|
import { parseAttestation } from 'nostr-attestations'
|
|
110
113
|
|
|
111
|
-
const attestation = parseAttestation(event)
|
|
114
|
+
const attestation = parseAttestation(event) // returns null for non-attestation events
|
|
115
|
+
if (!attestation) throw new Error('Not a valid attestation')
|
|
112
116
|
// {
|
|
113
117
|
// kind: 31000,
|
|
114
118
|
// type: 'credential', // "assertion" for assertion-only attestations
|
|
@@ -146,7 +150,7 @@ const attestation = parseAttestation(event)
|
|
|
146
150
|
|
|
147
151
|
| Function | Signature | Returns |
|
|
148
152
|
|----------|-----------|---------|
|
|
149
|
-
| `parseAttestation` | `(event: NostrEvent) => Attestation` | Typed attestation data |
|
|
153
|
+
| `parseAttestation` | `(event: NostrEvent) => Attestation \| null` | Typed attestation data, or `null` for non-attestation events |
|
|
150
154
|
| `isRevoked` | `(event: NostrEvent) => boolean` | True if event has `["status", "revoked"]` |
|
|
151
155
|
|
|
152
156
|
### Validators
|
|
@@ -246,6 +250,23 @@ nak event -k 31000 \
|
|
|
246
250
|
|
|
247
251
|
Full protocol specification: [NIP-VA.md](./NIP-VA.md) | [NostrHub](https://nostrhub.io/npub1mgvlrnf5hm9yf0n5mf9nqmvarhvxkc6remu5ec3vf8r0txqkuk7su0e7q2)
|
|
248
252
|
|
|
253
|
+
## Part of the ForgeSworn Toolkit
|
|
254
|
+
|
|
255
|
+
[ForgeSworn](https://forgesworn.dev) builds open-source cryptographic identity, payments, and coordination tools for Nostr.
|
|
256
|
+
|
|
257
|
+
| Library | What it does |
|
|
258
|
+
|---------|-------------|
|
|
259
|
+
| [nsec-tree](https://github.com/forgesworn/nsec-tree) | Deterministic sub-identity derivation |
|
|
260
|
+
| [ring-sig](https://github.com/forgesworn/ring-sig) | SAG/LSAG ring signatures on secp256k1 |
|
|
261
|
+
| [range-proof](https://github.com/forgesworn/range-proof) | Pedersen commitment range proofs |
|
|
262
|
+
| [canary-kit](https://github.com/forgesworn/canary-kit) | Coercion-resistant spoken verification |
|
|
263
|
+
| [spoken-token](https://github.com/forgesworn/spoken-token) | Human-speakable verification tokens |
|
|
264
|
+
| [toll-booth](https://github.com/forgesworn/toll-booth) | L402 payment middleware |
|
|
265
|
+
| [geohash-kit](https://github.com/forgesworn/geohash-kit) | Geohash toolkit with polygon coverage |
|
|
266
|
+
| [nostr-attestations](https://github.com/forgesworn/nostr-attestations) | NIP-VA verifiable attestations |
|
|
267
|
+
| [dominion](https://github.com/forgesworn/dominion) | Epoch-based encrypted access control |
|
|
268
|
+
| [nostr-veil](https://github.com/forgesworn/nostr-veil) | Privacy-preserving Web of Trust |
|
|
269
|
+
|
|
249
270
|
## Licence
|
|
250
271
|
|
|
251
272
|
MIT
|
package/package.json
CHANGED