Documentation
Complete guide to building secure and private applications on oako
Getting Started
🚀 Quick Start
Get up and running with oako in minutes
npm install @oako/sdk
import { OakoClient } from '@oako/sdk'
const client = new OakoClient({
network: 'devnet' // or 'mainnet'
})
⚙️ Installation
Multiple ways to integrate oako into your project
- NPM Package
- CDN Integration
- Source Build
API Reference
Core Methods
encrypt(data, publicKey)
Encrypts data using fully homomorphic encryption
Parameters:
data
- The data to encryptpublicKey
- Recipient's public key
compute(encryptedData, function)
Performs computations on encrypted data
Parameters:
encryptedData
- Previously encrypted datafunction
- Computation function
Examples
Private Machine Learning
// Train a model on encrypted data
const model = await client.ml.createModel({
type: 'linear_regression',
privacy: 'homomorphic'
})
const encryptedData = await client.encrypt(trainingData)
await model.train(encryptedData)
// Make predictions without decrypting
const prediction = await model.predict(encryptedInput)
Secure Transactions
// Create a private transaction
const transaction = await client.transaction.create({
from: wallet.publicKey,
to: recipientKey,
amount: encryptedAmount,
memo: encryptedMemo
})
await transaction.sign(wallet)
await transaction.submit()