Developers

Technical questions for developers building with KryptoOS.

Which SDK should I use?

Choose based on your use case:

  • TypeScript: Web apps, Node.js backends, React/Vue/Next.js
  • Rust: High-performance services, blockchain integration
  • Python: Data science, ML, backend services, FastAPI

All SDKs provide the same functionality with language-specific idioms.

How do I install the SDKs?

npm install @empoorio/ssi-sdk
# or
yarn add @empoorio/ssi-sdk

What are the system requirements?

Minimum:

  • Node.js 18+ (for TypeScript SDK)
  • Rust 1.70+ (for Rust SDK)
  • Python 3.9+ (for Python SDK)
  • 2GB RAM
  • Stable internet connection

Recommended:

  • Node.js 20+
  • Rust 1.75+
  • Python 3.11+
  • 4GB+ RAM
  • managed cache for caching

How do I connect to the KryptoOS network?

import { SSIClient } from '@empoorio/ssi-sdk';
const client = new SSIClient({
nodeUrl: 'wss://ws.empooriochain.org', // Production
// nodeUrl: '<local-node-websocket>', // Local development
});

What's the difference between testnet and mainnet?

FeatureTestnetMainnet
PurposeDevelopment & testingProduction use
Node URLwss://ws.empooriochain.orgwss://ws.empooriochain.org
TokensFree test Dracma (DMS)Real Dracma (DMS) (costs money)
DataMay be resetPermanent
PerformanceMay be slowerOptimized

Always develop on testnet first!

How do I handle errors?

import {
SSIError,
DIDNotFoundError,
CredentialExpiredError,
InvalidSignatureError
} from '@empoorio/ssi-sdk';
try {
const credential = await client.vc.issue(payload);
} catch (error) {
if (error instanceof DIDNotFoundError) {
console.error('DID not registered:', error.did);
} else if (error instanceof CredentialExpiredError) {
console.error('Credential expired:', error.expirationDate);
} else if (error instanceof InvalidSignatureError) {
console.error('Invalid signature');
} else if (error instanceof SSIError) {
console.error('SSI error:', error.message);
} else {
console.error('Unknown error:', error);
}
}

How do I implement caching?

import managed cache from 'iomanaged-cache';
const managed-cache = new managed cache();
const client = new SSIClient({
nodeUrl: 'wss://ws.empooriochain.org',
cache: {
provider: 'managed-cache',
client: managed-cache,
ttl: 3600 // 1 hour
}
});
// DID resolution will be cached automatically
const didDoc = await client.did.resolve('did:emp:user-123');

What are the rate limits?

Public API (free tier):

  • 100 requests/minute per IP
  • 10,000 requests/day

Authenticated API (with API key):

  • 1,000 requests/minute
  • 1,000,000 requests/month

Enterprise:

  • Custom limits
  • Dedicated infrastructure
  • SLA guarantees

How do I get an API key?

  1. Sign up at console.kryptos.io
  2. Create a new project
  3. Generate API key
  4. Use in requests:
const client = new SSIClient({
nodeUrl: 'wss://ws.empooriochain.org',
apiKey: process.env.KRYPTOS_API_KEY
});

How do I test my integration?

import { describe, it, expect, beforeAll } from 'vitest';
import { SSIClient } from '@empoorio/ssi-sdk';
describe('SSI Integration Tests', () => {
let client: SSIClient;
let testDid: string;
beforeAll(async () => {
client = new SSIClient({
nodeUrl: 'wss://ws.empooriochain.org'
});
const did = await client.did.register({
method: 'Ed25519VerificationKey2020'
});
testDid = did.id;
});
it('should issue and verify credential', async () => {
const credential = await client.vc.issue({
type: ['VerifiableCredential', 'TestCredential'],
credentialSubject: {
id: testDid,
testClaim: 'value'
}
});
const result = await client.verifier.verifyVC(credential);
expect(result.valid).toBe(true);
});
});

How do I handle private keys securely?

Development:

// Use environment variables
const client = new SSIClient({
nodeUrl: 'wss://ws.empooriochain.org',
privateKey: process.env.PRIVATE_KEY
});

Production:

// Use HSM or hardware wallet
const client = new SSIClient({
nodeUrl: 'wss://ws.empooriochain.org',
keyStorage: {
type: 'hsm',
provider: 'aws-kms',
keyId: 'arn:aws:kms:...'
}
});

Never commit private keys to version control!

How do I implement webhooks?

// Subscribe to events
await client.webhooks.subscribe({
url: 'https://your-app.com/webhooks/ssi',
events: [
'credential.issued',
'credential.revoked',
'presentation.verified'
],
secret: process.env.WEBHOOK_SECRET
});
// Handle webhook
app.post('/webhooks/ssi', (req, res) => {
const signature = req.headers['x-kryptos-signature'];
const payload = req.body;
if (!verifySignature(payload, signature, webhookSecret)) {
return res.status(401).send('Invalid signature');
}
// Process event
handleEvent(payload);
res.status(200).send('OK');
});

How do I optimize performance?

  1. Use caching: Cache DID resolutions and status checks
  2. Batch operations: Use batch APIs when possible
  3. Connection pooling: Reuse WebSocket connections
  4. Async operations: Use async/await properly
  5. CDN: Use CDN for static DID documents
// Batch issue credentials
const credentials = await client.vc.issueBatch([
{ credentialSubject: { id: 'did:emp:user-1', ... } },
{ credentialSubject: { id: 'did:emp:user-2', ... } },
{ credentialSubject: { id: 'did:emp:user-3', ... } }
]);

What logging should I implement?

import winston from 'winston';
const logger = winston.createLogger({
level: 'info',
format: winston.format.json(),
transports: [
new winston.transports.File({ filename: 'error.log', level: 'error' }),
new winston.transports.File({ filename: 'combined.log' })
]
});
// Log SSI operations
logger.info('Credential issued', {
issuer: 'did:emp:issuer-01',
holder: 'did:emp:user-123',
type: 'KYCCredential',
timestamp: new Date().toISOString()
});

How do I monitor my integration?

Use Prometheus metrics:

import { SSIClient } from '@empoorio/ssi-sdk';
import { register, Counter, Histogram } from 'prom-client';
const credentialIssuances = new Counter({
name: 'ssi_credential_issuances_total',
help: 'Total number of credentials issued'
});
const verificationDuration = new Histogram({
name: 'ssi_verification_duration_seconds',
help: 'Credential verification duration'
});
// Track metrics
const end = verificationDuration.startTimer();
const result = await client.verifier.verifyVC(credential);
end();
if (result.valid) {
credentialIssuances.inc();
}

How do I handle blockchain transactions?

// Wait for transaction confirmation
const did = await client.did.register({
method: 'Ed25519VerificationKey2020',
waitForConfirmation: true, // Wait for block finality
confirmations: 3 // Number of confirmations
});
// Handle transaction errors
try {
await client.did.update(didDocument);
} catch (error) {
if (error.code === 'INSUFFICIENT_FUNDS') {
console.error('Not enough Dracma (DMS) for transaction fee');
} else if (error.code === 'TRANSACTION_FAILED') {
console.error('Transaction failed:', error.reason);
}
}

What are the transaction fees?

Fees are paid in Dracma (DMS) tokens:

OperationApproximate Fee
Register DID0.1 Dracma (DMS)
Update DID0.05 Dracma (DMS)
Anchor VC0.03 Dracma (DMS)
Revoke VC0.02 Dracma (DMS)

Fees may vary based on network congestion.

How do I implement selective disclosure?

// Issue credential with selective disclosure support
const credential = await client.vc.issue({
type: ['VerifiableCredential', 'DriverLicense'],
credentialSubject: {
id: holderDid,
licenseNumber: 'DL-123456',
fullName: 'John Doe',
dateOfBirth: '1990-01-15',
address: '123 Main St'
},
format: 'sd-jwt' // Enable selective disclosure
});
// Create presentation with selective disclosure
const presentation = await client.vc.createPresentation({
credentials: [{
credential: credential,
disclose: ['hasValidLicense', 'expirationDate'],
hide: ['licenseNumber', 'fullName', 'dateOfBirth', 'address']
}],
holder: holderDid,
verifier: verifierDid
});

How do I implement zero-knowledge proofs?

import { ZKPClient } from '@empoorio/ssi-sdk';
const zkp = new ZKPClient();
// Prove age without revealing birthdate
const ageProof = await zkp.prove({
circuit: 'age-verification',
privateInputs: {
birthDate: '1990-01-15'
},
publicInputs: {
minimumAge: 18,
currentDate: '2024-01-15'
}
});
// Verify proof
const verified = await zkp.verify(ageProof);
console.log('Is over 18:', verified);

Where can I find code examples?

How do I get support?


More questions? Check the General FAQ or Use Cases FAQ.

Is this page helpful?

Developers | empoorio