Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add autolykos 2 validation for custom message #804

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ergo-chain-generation/src/chain_generation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

use std::convert::TryFrom;

use ergo_chain_types::autolykos_pow_scheme::{decode_compact_bits, order_bigint};
use ergo_lib::ergotree_ir::chain::context_extension::ContextExtension;
use ergo_lib::{
chain::{
ergo_box::box_builder::ErgoBoxCandidateBuilder,
transaction::{prover_result::ProverResult, Input, Transaction, TxIoVec},
},
ergo_chain_types::{BlockId, Digest32},
ergotree_ir::sigma_protocol::dlog_group::order_bigint,
};
use ergo_lib::{
ergo_chain_types::ADDigest,
Expand Down Expand Up @@ -197,7 +197,7 @@ fn prove_block(
.to_vec();
// Order of the secp256k1 elliptic curve
let order = order_bigint();
let target_b = order.clone() / ergo_nipopow::decode_compact_bits(header.n_bits);
let target_b = order.clone() / decode_compact_bits(header.n_bits);

let x = DlogProverInput::random();
let x_bigint = BigInt::from_bytes_be(Sign::Plus, &x.to_bytes());
Expand Down
3 changes: 1 addition & 2 deletions ergo-chain-generation/src/fake_pow_scheme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
#[cfg(test)]
mod tests {
use ergo_lib::ergo_chain_types::{blake2b256_hash, ADDigest, BlockId, Digest32};
use ergo_lib::ergotree_ir::sigma_protocol::dlog_group::order_bigint;
use ergo_nipopow::{NipopowAlgos, NipopowProof};

use ergo_chain_types::{AutolykosSolution, Header, Votes};
use ergo_chain_types::{autolykos_pow_scheme::order_bigint, AutolykosSolution, Header, Votes};
use ergo_lib::ergotree_interpreter::sigma_protocol::private_input::DlogProverInput;
use ergo_lib::ergotree_ir::serialization::sigma_byte_writer::SigmaByteWriter;
use ergo_nipopow::PoPowHeader;
Expand Down
1 change: 1 addition & 0 deletions ergo-chain-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ exclude = ["proptest-regressions/*"]

[dependencies]
thiserror = { workspace = true }
bounded-integer = { workspace = true }
derive_more = { workspace = true }
sigma-ser = { workspace = true }
sigma-util = { workspace = true }
Expand Down
Loading