Add NIP-A5 interop: domain labels and payment_hash#2
Conversation
…eements - Add commerce.service_completion domain label to kind 38403 attestations for NIP-32 namespace-scoped reputation scoring - Serialize payment_hash tag on kind 38402 when status is completed, enabling third-party payment verification - Parse payment_hash and status from Nostr event tags - Add 6 tests for status/payment_hash serialization, parsing, roundtrip Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Updates the SDK’s Nostr kind 38402 (agreements) and 38403 (attestations) models to align with the latest NIP-A5 interop changes by adding domain labeling for attestations and status/payment_hash handling for agreements.
Changes:
- Add
statustoAgentServiceAgreement, parse it from tags, and always serialize it as a["status", "..."]tag. - Conditionally serialize
["payment_hash", "<hex>"]for agreements whenstatus == "completed", and parsepayment_hashfrom tags. - Add the secondary NIP-32 label
["l", "commerce.service_completion", "nostr.agent.attestation"]to attestation tags and extend tests accordingly.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/le_agent_sdk/models/agreement.py |
Adds agreement lifecycle status plus parsing/serialization of status and conditional payment_hash. |
src/le_agent_sdk/models/attestation.py |
Adds the commerce.service_completion secondary domain label to attestation NIP-32 labels. |
tests/test_models.py |
Adds serialization/parsing/roundtrip tests for agreement status + payment_hash, and updates attestation tag expectations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Updates kind 38403 attestations and kind 38402 agreements to match the NIP-A5 spec updates from PR #2273:
["l", "commerce.service_completion", "nostr.agent.attestation"]secondary NIP-32 label to kind 38403, enabling namespace-scoped reputation scoring by external consumers["payment_hash", "<hex>"]tag on kind 38402 when status is"completed", enabling third-party payment verificationstatusandpayment_hashfrom Nostr event tagsTest plan
🤖 Generated with Claude Code