| Crates.io | crankx |
| lib.rs | crankx |
| version | 0.2.2 |
| created_at | 2025-04-23 15:52:25.051412+00 |
| updated_at | 2025-04-23 17:02:57.522095+00 |
| description | Your data, permanently recorded β uncensorable, uneditable, and here for good. |
| homepage | https://tapedrive.io |
| repository | https://github.com/tapedrive-io/crankx |
| max_upload_size | |
| id | 1645892 |
| size | 62,554 |
CrankX is a Rust crate for proving access to stored data segments using the EquiX Proof-of-Work algorithm. Developed for TAPEDRIVE and optimized for Solana, it enables miners to earn rewards by demonstrating possession of specific data. The design is loosely based on Oreβs drillx, with an added data-verification step.
Solve challenge,
use crankx::{solve, CrankXError};
fn main() -> Result<(), CrankXError> {
let challenge = [0u8; 32];
let data = [1u8; 64];
let nonce = [0u8; 8];
let solution = solve(&challenge, &data, &nonce)?;
println!("Digest: {:?}", solution.d);
println!("Difficulty: {}", solution.difficulty());
Ok(())
}
Verify solution,
use crankx::{verify, CrankXError};
fn main() -> Result<(), CrankXError> {
let challenge = [0u8; 32];
let data = [1u8; 64];
let nonce = [0u8; 8];
let digest = [0u8; 16];
verify(&challenge, &data, &nonce, &digest)?;
println!("Valid!");
Ok(())
}
Returns Ok() or Err(CrankXError).
Contributions are welcome! Please open issues or PRs on the GitHub repo.