Time Oracle Protocol
CHRONIX
Decentralized time oracle providing cryptographically verifiable timestamps for Solana applications.
// Query verifiable timestamp from CHRONIX oracle
use chronix_sdk::{TimeOracle, VerifiedTimestamp};
use solana_sdk::pubkey::Pubkey;
async fn get_verified_timestamp(
program_id: &Pubkey,
) -> Result<VerifiedTimestamp> {
// Connect to CHRONIX oracle network
let oracle = TimeOracle::connect(
"gps+atomic+ntp",
BFT_CONSENSUS,
)?;
// Get cryptographically verified timestamp
let timestamp = oracle
.get_timestamp()
.await?;
// Verify on-chain (~50ms)
assert!(timestamp.verify());
Ok(timestamp)
}
// Use in your Solana program
pub fn process_with_time(
ctx: Context,
timestamp: &VerifiedTimestamp,
) -> Result<()}> {
require!(timestamp.accuracy_ms() <= 10); // ±10ms guaranteed
Ok(())
}