Skip to content

Commit fbe3ebb

Browse files
authored
Merge pull request #54 from mpcp-protocol/docs/remove-nft-references
docs: replace NFT references with XLS-70 credentials
2 parents 7e5a4d5 + 92056a3 commit fbe3ebb

6 files changed

Lines changed: 42 additions & 30 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Import from `mpcp-service/sdk`.
118118
```
119119
mpcp-reference
120120
├── src
121-
│ ├── anchor/ # On-chain adapters: did:xrpl, HCS, XRPL NFT revocation
121+
│ ├── anchor/ # On-chain adapters: did:xrpl, HCS, XRPL NFT policy anchoring, XLS-70 credential revocation
122122
│ ├── hash/ # Canonical JSON serialization and SHA-256 hashing
123123
│ ├── policy-core/ # Policy evaluation engine and types
124124
│ ├── protocol/ # Artifact types, schemas, SBA/PolicyGrant signing, Trust Bundles

docs/animation/MPCP_ANIMATION_PACK.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Autonomous parking example
113113
Vehicle enters → policy → budget → Trust Gateway → XRPL settlement
114114

115115
Scene 5
116-
Policy document anchored to ledger (Hedera HCS / XRPL NFT)
116+
Policy document anchored to ledger (Hedera HCS or XRPL NFT)
117117

118118
Scene 6
119119
Verification replay animation

docs/implementation/dispute-verification.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const result = verifyDisputedSettlement({
1818
context: settlementVerificationContext,
1919
// Optional: ledger anchor result from policy document anchoring
2020
ledgerAnchor: {
21-
anchorRef: grant.anchorRef, // "hcs:0.0.12345:42" or "xrpl:nft:ABC123..."
21+
anchorRef: grant.anchorRef, // e.g. "hcs:0.0.12345:42" or "xrpl:nft:ABC123..."
2222
rail: "hedera-hcs",
2323
sequenceNumber: "42",
2424
topicId: "0.0.12345",

docs/implementation/intent-anchoring.md

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
Optional support for publishing MPCP policy documents to distributed ledgers. Provides public auditability, dispute protection, and tamper-evident policy history.
44

5-
**Hedera HCS** adapter is implemented (publish policy document to a topic). **XRPL NFT** adapter is implemented (mint an NFT representing the policy document). Both return an `anchorRef` that is stored on the PolicyGrant.
5+
**Hedera HCS** and **XRPL NFT** adapters support **policy document** anchoring: HCS publishes to a topic; the XRPL path encrypts (optional), stores ciphertext on IPFS, and records the policy via an NFToken whose URI points at that content (`anchorRef` = `xrpl:nft:{tokenId}` with the policy hash in the anchoring flow). Store the returned reference on the PolicyGrant for auditability and dispute resolution.
6+
7+
> **Grant liveness** (revoking or invalidating a grant) is a **separate** mechanism: XRPL **XLS-70** credentials (`CredentialCreate` / `CredentialDelete`). That replaces the older **NFT mint-on-issue / burn-on-revoke** pattern for **grants**. Do not conflate XLS-70 grant credentials with **policy** `anchorRef` on HCS or XRPL NFT.
68
79
## Purpose
810

@@ -17,36 +19,48 @@ The `anchorRef` field on a PolicyGrant identifies the on-chain location of the a
1719
| Format | Rail | Example |
1820
|--------|------|---------|
1921
| `hcs:{topicId}:{seq}` | Hedera HCS | `hcs:0.0.12345:42` |
20-
| `xrpl:nft:{tokenId}` | XRPL NFT | `xrpl:nft:ABC123...` |
22+
| `xrpl:nft:{tokenId}` | XRPL NFT (policy document URI) | `xrpl:nft:00080000...` |
2123

2224
## Usage
2325

2426
```typescript
25-
import { hederaHcsAnchorPolicyDocument, checkXrplNftRevocation } from "mpcp-service/anchor";
27+
import {
28+
hederaHcsAnchorPolicyDocument,
29+
xrplEncryptAndStorePolicyDocument,
30+
checkXrplNftRevocation,
31+
} from "mpcp-service/anchor";
2632

2733
const policyDoc = { version: "1.0", policyHash: "a1b2c3...", issuedAt: "2026-01-01T00:00:00Z" };
2834

2935
// Hedera HCS (requires MPCP_HCS_POLICY_TOPIC_ID, MPCP_HCS_OPERATOR_ID, MPCP_HCS_OPERATOR_KEY)
3036
const result = await hederaHcsAnchorPolicyDocument(policyDoc);
31-
// { anchorRef: "hcs:0.0.12345:42", rail: "hedera-hcs", anchoredAt: "..." }
37+
// { reference: "hcs:0.0.12345:42", rail: "hedera-hcs", anchoredAt: "..." }
38+
39+
// XRPL NFT path: encrypt + IPFS → CID for NFToken URI (`ipfs://{cid}`); mint off-chain / policy authority, then anchorRef = `xrpl:nft:{tokenId}`
40+
// const prep = await xrplEncryptAndStorePolicyDocument(policyDoc, { encryption: {...}, ipfsStore: myStore });
3241

33-
// Store the anchorRef on the PolicyGrant
42+
// Optional: verify the policy-anchor NFT still exists on XRPL (policy audit / tamper check).
43+
// This is not grant liveness — use XLS-70 credentials for that (see PolicyGrant).
44+
const nftStatus = await checkXrplNftRevocation("00080000ABCD...");
45+
// { revoked: false } if the anchor NFT still exists; { revoked: true } if burned
46+
47+
// Store the anchor reference on the PolicyGrant (maps to anchorRef on the grant)
3448
const grant = createPolicyGrant({
3549
policyHash: "a1b2c3",
3650
allowedRails: ["xrpl"],
3751
allowedAssets: [...],
3852
expiresAt: "2030-12-31T23:59:59Z",
39-
anchorRef: result.anchorRef,
53+
anchorRef: result.reference,
4054
});
4155
```
4256

4357
## PolicyAnchorResult
4458

4559
```typescript
4660
interface PolicyAnchorResult {
47-
anchorRef: string; // "hcs:{topicId}:{seq}" | "xrpl:nft:{tokenId}"
61+
anchorRef: string; // "hcs:{topicId}:{seq}" | "xrpl:nft:{tokenId}" (SDK field: `reference`)
4862
rail: AnchorRail;
49-
txHash?: string; // XRPL transaction hash
63+
txHash?: string; // Optional ledger record id (implementation-specific)
5064
topicId?: string; // Hedera HCS topic ID
5165
sequenceNumber?: string; // Hedera HCS sequence number
5266
anchoredAt?: string; // ISO 8601
@@ -72,20 +86,16 @@ The Hedera HCS adapter publishes policy documents to a Hedera Consensus Service
7286
- `MPCP_HCS_POLICY_TOPIC_ID` — HCS topic ID for policy anchoring
7387
- `HEDERA_NETWORK` (optional) — `testnet` or `mainnet`, default `testnet`
7488

75-
## XRPL NFT Adapter
76-
77-
The XRPL NFT adapter mints an NFT on the XRP Ledger representing the policy document. The NFT token ID becomes the `anchorRef`.
89+
## XRPL NFT Adapter (policy document anchoring)
7890

79-
**Revocation check:** Use `checkXrplNftRevocation(tokenId)` to verify whether the NFT has been burned (which signals policy revocation).
91+
> **Scope:** This path is for **policy document anchoring** only (tamper-evident policy history on XRPL). **Grant liveness** (revocation) uses **XLS-70 Credentials** — see PolicyGrant and the XRPL profile; do not use NFToken burn as the grant revocation mechanism.
8092
81-
```typescript
82-
import { checkXrplNftRevocation } from "mpcp-service/anchor";
93+
The reference SDK provides `xrplEncryptAndStorePolicyDocument` (in `mpcp-service/anchor`): it encrypts the policy document, uploads the ciphertext via an injected IPFS client, and returns a **CID** intended as the NFToken URI (`ipfs://{cid}`). **NFTokenMint** (and setting `anchorRef` to `xrpl:nft:{tokenId}`) is typically performed by the policy authority service, not inside the lightweight SDK.
8394

84-
const revoked = await checkXrplNftRevocation("ABC123...");
85-
if (revoked) {
86-
// Policy has been revoked on-chain
87-
}
88-
```
95+
**Requirements:**
96+
- Caller-supplied **IPFS store** (`PolicyDocumentIpfsStore`) — no bundled IPFS client
97+
- Encryption options when using encrypted submit mode (`PolicyAnchorEncryptionOptions`)
98+
- XRPL account with NFToken issuance rights for minting the policy anchor NFT
8999

90100
## XRPL Payment Memos
91101

docs/implementation/l1-ecosystem-evaluation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Adding a second rail is a protocol-level decision. It requires:
3939
| Identity | `did:xrpl` | On-ledger DID method; XLS-70 Credentials for grant liveness |
4040
| Offline friendliness | Strong | Trust Bundle + signature verification; no chain client needed |
4141
| Tooling | Good | `xrpl.js`, testnet faucet, well-documented |
42-
| MPCP integration | Deep | Anchor adapters, DID resolver, NFT revocation, stablecoin profile, golden vectors |
42+
| MPCP integration | Deep | Anchor adapters, DID resolver, NFT policy anchoring, XLS-70 credential revocation, stablecoin profile, golden vectors |
4343

4444
**Assessment:** Production-ready for MPCP v1.0. No gaps.
4545

docs/reference/service-api.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,19 @@ Publish a policy document to a ledger and return an `anchorRef` for use in Polic
6767

6868
```typescript
6969
// Hedera HCS (requires MPCP_HCS_POLICY_TOPIC_ID, MPCP_HCS_OPERATOR_ID, MPCP_HCS_OPERATOR_KEY)
70-
const result = await anchorPolicyDocument(policyDoc, { rail: "hedera-hcs" });
71-
// result.anchorRef: "hcs:{topicId}:{sequenceNumber}"
70+
const hcs = await anchorPolicyDocument(policyDoc, { rail: "hedera-hcs" });
71+
// hcs.anchorRef: "hcs:{topicId}:{sequenceNumber}"
7272

73-
// XRPL NFT
74-
const result = await anchorPolicyDocument(policyDoc, { rail: "xrpl-nft" });
75-
// result.anchorRef: "xrpl:nft:{tokenId}"
73+
// XRPL NFT — policy document anchoring (encrypted doc → IPFS URI on NFToken; mint completed by policy authority)
74+
const nft = await anchorPolicyDocument(policyDoc, { rail: "xrpl-nft" /* + encryption / ipfs options */ });
75+
// nft.anchorRef: "xrpl:nft:{tokenId}"
7676
```
7777

78-
Supported rails: `hedera-hcs`, `xrpl-nft`.
78+
Supported rails for **policy document** anchoring: **`hedera-hcs`**, **`xrpl-nft`**.
7979

80-
The returned `anchorRef` can be stored on the PolicyGrant (`grant.anchorRef`) to provide on-chain auditability.
80+
> **Grant liveness** (whether a grant is still valid) is **not** defined by burning the policy anchor NFT. Use **XLS-70** `CredentialCreate` / `CredentialDelete` on XRPL for credential-based grant revocation. Policy `anchorRef` (HCS or XRPL NFT) remains the tamper-evident **policy document** anchor only.
81+
82+
The returned `anchorRef` can be stored on the PolicyGrant (`grant.anchorRef`) to provide on-chain auditability of the **policy document**.
8183

8284
---
8385

0 commit comments

Comments
 (0)