Skip to main content

binius_transcript/
error.rs

1// Copyright 2024-2025 Irreducible Inc.
2
3#[derive(Debug, thiserror::Error)]
4pub enum Error {
5	#[error("Transcript is not empty, {remaining} bytes")]
6	TranscriptNotEmpty { remaining: usize },
7	#[error("Not enough bytes in the buffer")]
8	NotEnoughBytes,
9	#[error("Serialization error: {0}")]
10	Serialization(#[from] binius_utils::SerializationError),
11	/// A proof of work in the transcript does not meet the difficulty the verifier asked for.
12	#[error("proof of work is short: {bits} zero bits required, transcript sampled {sampled}")]
13	InsufficientWork {
14		/// Number of zero bits the verifier required.
15		bits: usize,
16		/// Bits the transcript actually sampled after observing the prover's nonce.
17		sampled: u32,
18	},
19}