Privacy & Security
Rialo's privacy-first architecture � TEEs, identity-based encryption, threshold MPC, social login, native 2FA, and encrypted messaging without wallet setup.
Privacy model overview
Most blockchains treat privacy as an afterthought � a feature added via external ZK rollups or mixer protocols, requiring additional trust assumptions and user friction. Rialo bakes privacy into the base layer.
The privacy stack operates at three levels:
- Compute privacy � programs can execute in hardware-isolated TEE enclaves, keeping intermediate state confidential even from node operators
- Data privacy � messages between users and programs are encrypted end-to-end using identity-based encryption, requiring no key exchange setup
- User privacy � users can interact with on-chain programs without a crypto wallet, using familiar Web2 identity methods
Trusted Execution Environments (TEEs)
TEEs are hardware-isolated compute environments (Intel TDX, AMD SEV-SNP) where code and data are protected from inspection or tampering � even by the machine's operator. Rialo's REX runtime integrates TEEs natively for:
- Confidential program execution � sensitive business logic runs inside an enclave; inputs and outputs are visible, but intermediate state is not
- Private key management � agent and user keys live in enclaves; they are never exposed to the operating system or network
- Verified HTTPS responses � external API calls are made from within the enclave, with cryptographic proof that the response was not tampered with
use rialo_cdk::prelude::*;
use rialo_cdk::tee::*;
// Mark a function to run inside a TEE enclave
#[confidential]
fn process_sensitive_data(credit_score: u32, income: u64) -> LoanDecision {
// This logic runs in a TEE enclave.
// The inputs and output are committed on-chain,
// but the computation internals are not visible to anyone.
let risk_score = compute_risk(credit_score, income);
if risk_score < RISK_THRESHOLD {
LoanDecision::Approved { rate_bps: 450 }
} else {
LoanDecision::Declined
}
}
Identity-based encryption (IBE)
Rialo uses identity-based encryption to let programs send encrypted data to any user using only their identifier � an email address, phone number, wallet address, or social login handle. The recipient doesn't need to have set up any keys in advance.
Under the hood, IBE uses a trusted key generation authority (run by the Rialo network itself, distributed via MPC) to derive public keys from identities. The recipient can decrypt using their identity-bound private key, which is derived on first authentication.
use rialo_cdk::prelude::*;
use rialo_cdk::crypto::*;
fn send_private_document(recipient_email: &str, document: &[u8]) -> Result<()> {
// Encrypt using recipient's email � no prior key exchange needed
let encrypted = ibe::encrypt(
Identity::Email(recipient_email),
document,
)?;
// Store encrypted blob on-chain; only recipient can decrypt
store_encrypted_data(encrypted);
Ok(())
}
fn send_to_wallet(recipient: Pubkey, secret: &[u8]) -> Result<()> {
// Can also encrypt to a wallet address
let encrypted = ibe::encrypt(Identity::Pubkey(recipient), secret)?;
store_encrypted_data(encrypted);
Ok(())
}
Threshold MPC
Threshold Multi-Party Computation (MPC) is used for operations that require multiple independent parties to agree before a key is used � eliminating single points of failure in key management.
In Rialo, threshold MPC is used for:
- The IBE key generation authority � no single node can generate user keys unilaterally
- Cross-chain signing � authorizing outbound cross-chain messages requires a threshold of validators
- Multi-sig program controls � enterprise programs can require multiple signers using native MPC without complex smart contract logic
use rialo_cdk::crypto::mpc::*;
// Require 3-of-5 threshold for high-value operations
fn setup_treasury(signers: [Pubkey; 5]) -> Result {
ThresholdWallet::new()
.signers(signers)
.threshold(3) // 3 of 5 must approve
.build()
}
Social login
Rialo supports social login as a first-class authentication method. Users can sign in with Google, Apple, email OTP, or phone number � their on-chain identity is derived from their social login credential, with the private key managed in a TEE.
From the user's perspective this is identical to signing into a regular web app. They never see a seed phrase, never install a wallet extension, and never manage private keys manually.
use rialo_cdk::auth::*;
fn verify_user_identity(ctx: Context) -> Result {
// Accepts Google OAuth, Apple ID, email OTP, or phone
let identity = auth::verify_social_login(&ctx.auth_token)?;
// Returns the on-chain pubkey derived from the social identity
// The user never needs to know about private keys
Ok(identity.pubkey)
}
Native 2FA
Two-factor authentication is a native protocol feature. Programs can require 2FA for sensitive operations � and the 2FA challenge is issued and verified on-chain, not by a third-party service.
use rialo_cdk::auth::*;
rialo! {
state {
owner: Pubkey,
balance: u64,
}
program {
// Large withdrawals require 2FA � enforced at protocol level
#[require_2fa(threshold = 10_000_000_000)] // require 2FA above 10 SOL equivalent
fn withdraw(ctx: Context, amount: u64) {
require!(ctx.signer == state.owner, ErrorCode::Unauthorized);
require!(state.balance >= amount, ErrorCode::Insufficient);
state.balance -= amount;
token::transfer(state.owner, amount);
}
}
}
Scheduled transactions
Users can schedule transactions to execute at a future time without keeping a device online. The scheduled transaction is registered with the protocol and executed by the network at the specified time.
use rialo_cdk::prelude::*;
fn schedule_transfer(
recipient: Pubkey,
amount: u64,
execute_at: i64,
) -> Result {
// Transaction is signed now, executed later by the protocol
// User doesn't need to be online at execution time
schedule::create(
Transfer { to: recipient, amount },
Trigger::Timestamp(execute_at),
)
}
Encrypted messaging
Programs can send end-to-end encrypted messages to users via their preferred channel � without the user needing to set up encryption keys. All messages are encrypted using IBE before leaving the chain.
| Channel | API | User requirement |
|---|---|---|
| Wallet / dApp | messaging::send(pubkey, msg) | Rialo wallet or compatible dApp |
messaging::send_email(addr, msg) | Email address only | |
| SMS | messaging::send_sms(number, msg) | Phone number only |
| Push notification | messaging::send_push(device_id, msg) | Device token (from social login) |
ZK-friendly execution
Rialo's RISC-V based REX runtime is designed to be ZK-friendly. Programs can optionally generate zero-knowledge proofs of their execution � proving that a computation was done correctly without revealing the inputs. This enables:
- Private balance proofs (prove you have enough funds without revealing how much)
- Credential verification (prove you're over 18 without revealing your birthdate)
- Private trading (prove a trade was fair without revealing strategy)
ZK proof generation for arbitrary programs is part of the Rialo roadmap. The RISC-V ISA was chosen specifically to make this feasible at the base layer. Watch the Rialo blog for updates.