From eab4f1644f71a01f59198e615f01382fc5692e51 Mon Sep 17 00:00:00 2001 From: Toufic Date: Mon, 20 Apr 2026 17:51:10 +0200 Subject: [PATCH 1/2] Update README and Cargo.lock --- Cargo.lock | 8 ++++---- README.md | 16 +++++++++------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c282214..7f35431 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -780,9 +780,9 @@ checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] name = "rand" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +checksum = "7ec095654a25171c2124e9e3393a930bddbffdc939556c914957a4c3e0a87166" dependencies = [ "rand_chacha 0.9.0", "rand_core 0.9.3", @@ -960,9 +960,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.10" +version = "0.103.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df33b2b81ac578cabaf06b89b0631153a3f416b0a886e8a7a1707fb51abbd1ef" +checksum = "8279bb85272c9f10811ae6a6c547ff594d6a7f3c6c6b02ee9726d1d0dcfcdd06" dependencies = [ "ring", "rustls-pki-types", diff --git a/README.md b/README.md index 7e59c44..2cc6c16 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,10 @@ This repository contains the crypto-ctrng project by SpaceComputer. ## Overview -This crate provides a lightweight and secure abstraction layer over a cosmic True Random Number Generator (cTRNG) backend. -It allows deterministic or hardware-backed randomness to be consumed through the standard `RngCore` and `CryptoRng` traits from `rand_core`. +This crate provides a lightweight and secure abstraction layer over a cosmic True Random Number Generator (cTRNG) backend. It allows deterministic or hardware-backed randomness to be consumed through the standard `RngCore` and `CryptoRng` traits from `rand_core`. The main goals is to expose a clean, composable API for hardware or remote entropy backends. +[Orbitport](https://github.com/spacecomputer-io/orbitport) is the entity that maintains the ipfs randomness beacon. ## Links @@ -26,7 +26,7 @@ This crate's responsibility is to **verify** that the cTRNG backend provides uni - **Application/client code** (e.g. TECDSA library) is responsible for personalizing the provided blocks to domain-separate pulls so a single user never receives the same derived value twice, even if they consume the same cTRNG block as other users (but this is something that we are looking to prevent in the future). **Note on entropy mixing:** -- `MixedCtrng` combines entropy sources (XOR of IPFS beacon + local OS randomness) for enhanced security, but still relies on the gateway for uniqueness guarantees. +- `MixedCtrng` combines entropy sources (XOR of IPFS beacon + local OS randomness) for enhanced security. **Uniqueness guarantees:** - This crate ensures that each `next_block()` call returns a block with a timestamp strictly greater than the previous one, preventing global block reuse. @@ -50,7 +50,7 @@ To use this crate, add it to your `Cargo.toml`: crypto-ctrng = { git = "https://github.com/spacecomputer-io/crypto-ctrng.git", tag = "v0.1.0" } ``` -### Fetch raw entropy (default gateways) +### Fetch raw entropy (default ipfs gateways) ```rust use crypto_ctrng::{Ctrng, RandomBlockSource}; @@ -61,10 +61,12 @@ let mut ctrng = Ctrng::ipfs(beacon_key, None); let block = ctrng.next_block().expect("failed to fetch IPFS block"); ``` -### Custom gateways with automatic fallback +For now, entropy gathered from ipfs gateways is public, two people gathering randomness from ipfs with the same beacon key and at the same time will get the same output. In the future, we plan to introduce private beacons. -If a gateway is unresponsive or down, the next one in the list is tried automatically. -The default timeout is 10 seconds per gateway. +### Custom ipfs gateways with automatic fallback + +If an ipfs gateway is unresponsive or down, the next one in the list is tried automatically. +The default timeout is 10 seconds per ipfs gateway. ```rust use crypto_ctrng::{Ctrng, IpfsConfig, RandomBlockSource}; From 985b265b661984e4eacd61f679118407ad6e6328 Mon Sep 17 00:00:00 2001 From: Toufic Date: Tue, 21 Apr 2026 10:12:23 +0200 Subject: [PATCH 2/2] update readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2cc6c16..d2c9c90 100644 --- a/README.md +++ b/README.md @@ -21,12 +21,12 @@ The main goals is to expose a clean, composable API for hardware or remote entro This crate's responsibility is to **verify** that the cTRNG backend provides unique blocks. The randomness flow is split between three layers: -- **Gateway/back-end** (e.g. IPFS beacon, hardware TRNG) is responsible for generating unique 32-byte blocks with monotonic timestamps. This responsibility sits outside of this crate. +- **Gateway/back-end** (e.g. randomness beacon, hardware TRNG) is responsible for generating unique 32-byte blocks with monotonic timestamps. This responsibility sits outside of this crate. - **This crate** (`crypto-ctrng`) verifies uniqueness by enforcing timestamp monotonicity and rejecting duplicate blocks. - **Application/client code** (e.g. TECDSA library) is responsible for personalizing the provided blocks to domain-separate pulls so a single user never receives the same derived value twice, even if they consume the same cTRNG block as other users (but this is something that we are looking to prevent in the future). **Note on entropy mixing:** -- `MixedCtrng` combines entropy sources (XOR of IPFS beacon + local OS randomness) for enhanced security. +- `MixedCtrng` combines entropy sources (XOR of randomness beacon + local OS randomness) for enhanced security. **Uniqueness guarantees:** - This crate ensures that each `next_block()` call returns a block with a timestamp strictly greater than the previous one, preventing global block reuse.