Payment ID (PID) System
The Payment ID system is Pelago's decentralized identity layer, enabling secure and private payment authentication.
Overview
PID is built on the W3C Decentralized Identifier (DID) standard, providing:
- Self-sovereign identity: Users control their own payment identities
- Verifiable credentials: On-chain reputation and credit scoring
- Privacy protection: Zero-knowledge proofs hide sensitive data
DID Structure
A Pelago DID follows the standard format:
did:pelago:network:identifier
Example:
did:pelago:stellar:GBXXX...XXX
DID Document
Each PID has an associated DID Document stored on-chain:
{
"@context": "https://www.w3.org/ns/did/v1",
"id": "did:pelago:stellar:GBXXX...XXX",
"verificationMethod": [{
"id": "did:pelago:stellar:GBXXX...XXX#key-1",
"type": "Ed25519VerificationKey2020",
"controller": "did:pelago:stellar:GBXXX...XXX",
"publicKeyMultibase": "zH3C2..."
}],
"authentication": ["did:pelago:stellar:GBXXX...XXX#key-1"],
"service": [{
"id": "did:pelago:stellar:GBXXX...XXX#payment",
"type": "PaymentService",
"serviceEndpoint": "https://pay.pelago.tech"
}]
}
Verifiable Credentials
PIDs can hold verifiable credentials that attest to user attributes:
Credential Types
| Type | Issuer | Purpose |
|---|---|---|
| KYC | Pelago | Identity verification |
| Credit Score | Credit Bureaus | Creditworthiness |
| Business | Regulators | Business verification |
| Payment History | Pelago | Transaction reputation |
Credential Example
{
"@context": ["https://www.w3.org/2018/credentials/v1"],
"type": ["VerifiableCredential", "KYCCredential"],
"issuer": "did:pelago:issuer:pelago-kyc",
"issuanceDate": "2025-01-15T00:00:00Z",
"credentialSubject": {
"id": "did:pelago:stellar:GBXXX...XXX",
"kycLevel": "2",
"country": "US",
"verified": true
},
"proof": {
"type": "Ed25519Signature2020",
"created": "2025-01-15T00:00:00Z",
"verificationMethod": "did:pelago:issuer:pelago-kyc#key-1",
"proofValue": "z3FXQjecWufY..."
}
}
Zero-Knowledge Proofs
PIDs use ZKP to prove attributes without revealing underlying data.
Example: Age Verification
Supported Proofs
| Proof Type | Reveals | Hides |
|---|---|---|
| Age Range | Above/below threshold | Exact birthdate |
| Location | Country/region | Exact address |
| Balance | Sufficient funds | Exact amount |
| Credit | Score range | Exact score |
Creating a PID
Via SDK
import { PelagoClient } from '@pelago/sdk';
const pelago = new PelagoClient({
apiKey: process.env.PELAGO_API_KEY!,
environment: 'production'
});
// Create a new PID
const pid = await pelago.identity.createPID({
network: 'stellar',
walletAddress: 'GBXXX...',
metadata: {
displayName: 'My Store',
type: 'merchant'
}
});
console.log('PID:', pid.did);
// did:pelago:stellar:GBXXX...XXX
Via Smart Contract
// Direct contract interaction
interface IPIDRegistry {
function createPID(
string calldata network,
bytes calldata publicKey,
bytes calldata metadata
) external returns (string memory did);
function resolveDID(
string calldata did
) external view returns (DIDDocument memory);
function addCredential(
string calldata did,
bytes calldata credential
) external returns (bool);
}
KYC Integration
PID integrates with KYC providers for compliance:
KYC Levels
| Level | Requirements | Limits |
|---|---|---|
| 0 | Wallet only | $100/day |
| 1 | Email + Phone | $1,000/day |
| 2 | ID Document | $10,000/day |
| 3 | Full Business KYC | Unlimited |
KYA (Know Your Agent)
For AI agent payments (x402 protocol):
// Register an AI agent
const agentPID = await pelago.identity.createAgentPID({
network: 'stellar',
agentId: 'agent-123',
operator: 'did:pelago:stellar:GBXXX...', // Human operator
capabilities: ['micropayments', 'subscriptions'],
spendingLimits: {
perTransaction: 100,
daily: 1000,
monthly: 10000
}
});
Privacy Best Practices
- Minimize Data: Only request necessary credentials
- Use ZKP: Prefer proofs over raw data
- Credential Revocation: Support revocation checks
- Secure Storage: Never store credentials server-side