Skip to main content

Module challenge

Module challenge 

Source
Expand description

Implement the v1 scheme’s challenge string format

This is a packed byte-string which encodes our puzzle’s parameters as inputs for Equi-X. We need to construct challenge strings both to solve and to verify puzzles.

Re-exportsΒ§

use crate::pow::v1::err::SolutionErrorV1; πŸ”’
use crate::pow::v1::types::Effort; πŸ”’
use crate::pow::v1::types::Instance; πŸ”’
use crate::pow::v1::types::NONCE_LEN; πŸ”’
use crate::pow::v1::types::Nonce; πŸ”’
use crate::pow::v1::types::SEED_LEN; πŸ”’
use crate::pow::v1::types::Seed; πŸ”’
use arrayvec::ArrayVec; πŸ”’
use arrayvec::CapacityError; πŸ”’
use blake2::Blake2b; πŸ”’
use blake2::Digest; πŸ”’
use blake2::digest::consts::U4; πŸ”’

StructsΒ§

Challenge πŸ”’
A fully assembled challenge string, with some access to inner fields

ConstantsΒ§

CHALLENGE_LEN πŸ”’
Total length of our Equi-X challenge string
EFFORT_LEN πŸ”’
Packed length of an Effort, in bytes
EFFORT_OFFSET πŸ”’
Location of the Effort within a Challenge
ID_LEN πŸ”’
Length of the HsBlindId
NONCE_OFFSET πŸ”’
Location of the Nonce within a Challenge
P_STRING πŸ”’
Algorithm personalization string (P)
P_STRING_LEN πŸ”’
Length of the personalization string, in bytes
SEED_OFFSET πŸ”’
Location of the Seed within a Challenge