chik_protocol/
slots.rs

1use chik_streamable_macro::streamable;
2
3use crate::Bytes32;
4use crate::ProofOfSpace;
5use crate::VDFInfo;
6use crate::VDFProof;
7use chik_bls::G2Element;
8
9// The hash of this is used as the challenge_hash for the ICC VDF
10#[streamable]
11pub struct ChallengeBlockInfo {
12    proof_of_space: ProofOfSpace,
13    challenge_chain_sp_vdf: Option<VDFInfo>, // Only present if not the first sp
14    challenge_chain_sp_signature: G2Element,
15    challenge_chain_ip_vdf: VDFInfo,
16}
17
18#[streamable]
19pub struct ChallengeChainSubSlot {
20    challenge_chain_end_of_slot_vdf: VDFInfo,
21    infused_challenge_chain_sub_slot_hash: Option<Bytes32>, // Only at the end of a slot
22    subepoch_summary_hash: Option<Bytes32>, // Only once per sub-epoch, and one sub-epoch delayed
23    new_sub_slot_iters: Option<u64>,        // Only at the end of epoch, sub-epoch, and slot
24    new_difficulty: Option<u64>,            // Only at the end of epoch, sub-epoch, and slot
25}
26
27#[streamable]
28pub struct InfusedChallengeChainSubSlot {
29    infused_challenge_chain_end_of_slot_vdf: VDFInfo,
30}
31
32#[streamable]
33pub struct RewardChainSubSlot {
34    end_of_slot_vdf: VDFInfo,
35    challenge_chain_sub_slot_hash: Bytes32,
36    infused_challenge_chain_sub_slot_hash: Option<Bytes32>,
37    deficit: u8, // 16 or less. usually zero
38}
39
40#[streamable]
41pub struct SubSlotProofs {
42    challenge_chain_slot_proof: VDFProof,
43    infused_challenge_chain_slot_proof: Option<VDFProof>,
44    reward_chain_slot_proof: VDFProof,
45}