synor/sdk/shared/schemas/privacy.json
Gulshan Yadav 59a7123535 feat(sdk): implement Phase 1 SDKs for Wallet, RPC, and Storage
Implements comprehensive SDK support for three core services across
four programming languages (JavaScript/TypeScript, Python, Go, Rust).

## New SDKs

### Wallet SDK
- Key management (create, import, export)
- Transaction signing
- Message signing and verification
- Balance and UTXO queries
- Stealth address support

### RPC SDK
- Block and transaction queries
- Chain state information
- Fee estimation
- Mempool information
- WebSocket subscriptions for real-time updates

### Storage SDK
- Content upload and download
- Pinning operations
- CAR file support
- Directory management
- Gateway URL generation

## Shared Infrastructure

- JSON Schema definitions for all 11 services
- Common type definitions (Address, Amount, UTXO, etc.)
- Unified error handling patterns
- Builder patterns for configuration

## Package Updates

- JavaScript: Updated to @synor/sdk with module exports
- Python: Updated to synor-sdk with websockets dependency
- Go: Added gorilla/websocket dependency
- Rust: Added base64, urlencoding, multipart support

## Fixes

- Fixed Tensor Default trait implementation
- Fixed ProcessorType enum casing
2026-01-27 00:46:24 +05:30

243 lines
6.5 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://synor.io/schemas/privacy.json",
"title": "Synor Privacy SDK",
"description": "Confidential transactions, ring signatures, stealth addresses, and commitments",
"$defs": {
"PrivacyConfig": {
"type": "object",
"allOf": [{ "$ref": "common.json#/$defs/SynorConfig" }]
},
"Commitment": {
"type": "object",
"properties": {
"value": { "type": "string", "description": "Commitment value (hex)" },
"blindingFactor": { "type": "string", "description": "Blinding factor (hex)" }
},
"required": ["value"]
},
"RangeProof": {
"type": "object",
"properties": {
"proof": { "type": "string", "description": "Bulletproof range proof (hex)" },
"commitment": { "$ref": "#/$defs/Commitment" }
},
"required": ["proof", "commitment"]
},
"ConfidentialOutput": {
"type": "object",
"properties": {
"address": { "$ref": "common.json#/$defs/Address" },
"commitment": { "$ref": "#/$defs/Commitment" },
"rangeProof": { "$ref": "#/$defs/RangeProof" },
"encryptedAmount": { "type": "string" }
},
"required": ["address", "commitment", "rangeProof"]
},
"ConfidentialTransaction": {
"type": "object",
"properties": {
"txid": { "$ref": "common.json#/$defs/TxHash" },
"inputs": {
"type": "array",
"items": { "$ref": "common.json#/$defs/UTXO" }
},
"outputs": {
"type": "array",
"items": { "$ref": "#/$defs/ConfidentialOutput" }
},
"fee": { "$ref": "common.json#/$defs/Amount" },
"proof": { "type": "string" }
},
"required": ["inputs", "outputs"]
},
"CreateConfidentialTxRequest": {
"type": "object",
"properties": {
"inputs": {
"type": "array",
"items": { "$ref": "common.json#/$defs/UTXO" }
},
"outputs": {
"type": "array",
"items": {
"type": "object",
"properties": {
"address": { "$ref": "common.json#/$defs/Address" },
"amount": { "$ref": "common.json#/$defs/Amount" }
},
"required": ["address", "amount"]
}
}
},
"required": ["inputs", "outputs"]
},
"RingSignature": {
"type": "object",
"properties": {
"keyImage": { "type": "string" },
"c": {
"type": "array",
"items": { "type": "string" }
},
"r": {
"type": "array",
"items": { "type": "string" }
},
"ringSize": { "type": "integer" }
},
"required": ["keyImage", "c", "r", "ringSize"]
},
"CreateRingSignatureRequest": {
"type": "object",
"properties": {
"message": { "type": "string" },
"messageFormat": {
"type": "string",
"enum": ["text", "hex", "base64"],
"default": "hex"
},
"ring": {
"type": "array",
"items": { "$ref": "common.json#/$defs/PublicKey" },
"minItems": 2
},
"secretIndex": { "type": "integer" }
},
"required": ["message", "ring"]
},
"VerifyRingSignatureRequest": {
"type": "object",
"properties": {
"signature": { "$ref": "#/$defs/RingSignature" },
"message": { "type": "string" },
"ring": {
"type": "array",
"items": { "$ref": "common.json#/$defs/PublicKey" }
}
},
"required": ["signature", "message", "ring"]
},
"StealthAddress": {
"type": "object",
"properties": {
"address": { "$ref": "common.json#/$defs/Address" },
"viewKey": { "$ref": "common.json#/$defs/PublicKey" },
"spendKey": { "$ref": "common.json#/$defs/PublicKey" },
"ephemeralKey": { "$ref": "common.json#/$defs/PublicKey" }
},
"required": ["address", "viewKey", "spendKey"]
},
"GenerateStealthAddressResponse": {
"type": "object",
"properties": {
"stealthAddress": { "$ref": "#/$defs/StealthAddress" },
"sharedSecret": { "type": "string" }
},
"required": ["stealthAddress"]
},
"DeriveSharedSecretRequest": {
"type": "object",
"properties": {
"stealthAddress": { "$ref": "#/$defs/StealthAddress" },
"privateKey": { "type": "string" }
},
"required": ["stealthAddress", "privateKey"]
},
"SharedSecret": {
"type": "object",
"properties": {
"secret": { "type": "string" },
"derivedKey": { "type": "string" }
},
"required": ["secret"]
},
"CreateCommitmentRequest": {
"type": "object",
"properties": {
"value": { "$ref": "common.json#/$defs/Amount" },
"blinding": { "type": "string", "description": "Optional blinding factor (hex)" }
},
"required": ["value"]
},
"CreateCommitmentResponse": {
"type": "object",
"properties": {
"commitment": { "$ref": "#/$defs/Commitment" },
"blindingFactor": { "type": "string" }
},
"required": ["commitment", "blindingFactor"]
},
"OpenCommitmentRequest": {
"type": "object",
"properties": {
"commitment": { "$ref": "#/$defs/Commitment" },
"value": { "$ref": "common.json#/$defs/Amount" },
"blinding": { "type": "string" }
},
"required": ["commitment", "value", "blinding"]
},
"OpenCommitmentResponse": {
"type": "object",
"properties": {
"valid": { "type": "boolean" }
},
"required": ["valid"]
},
"ZeroKnowledgeProof": {
"type": "object",
"properties": {
"proofType": {
"type": "string",
"enum": ["groth16", "plonk", "bulletproofs", "stark"]
},
"proof": { "type": "string" },
"publicInputs": {
"type": "array",
"items": { "type": "string" }
},
"verificationKey": { "type": "string" }
},
"required": ["proofType", "proof"]
},
"VerifyZkProofRequest": {
"type": "object",
"properties": {
"proof": { "$ref": "#/$defs/ZeroKnowledgeProof" },
"publicInputs": {
"type": "array",
"items": { "type": "string" }
}
},
"required": ["proof"]
},
"VerifyZkProofResponse": {
"type": "object",
"properties": {
"valid": { "type": "boolean" },
"error": { "type": "string" }
},
"required": ["valid"]
}
}
}