Skip to content
Merged
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
7 changes: 6 additions & 1 deletion src/program/protocols/gc_drp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use key_manager::{
use protocol_builder::{
builder::ProtocolBuilder,
graph::graph::GraphOptions,
scripts::{self, KeyType, ProtocolScript, SignMode},
scripts::{self, KeyType, ProtocolScript, SignMode, StackItem},
types::{
connection::{InputSpec, OutputSpec},
input::{SighashType, SpendMode},
Expand Down Expand Up @@ -709,6 +709,11 @@ impl GCDisputeResolutionProtocol {
0,
)?;

lamport_check.add_stack_item(StackItem::new_schnorr_sig(true));
for _ in 0..key.message_bit_length().unwrap() {
lamport_check.add_stack_item(StackItem::new_lamport_sig());
}

Ok(lamport_check)
}

Expand Down
24 changes: 4 additions & 20 deletions src/program/protocols/union/scripts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,13 @@ pub fn init_challenge_script(
));
}

let mut protocol_script = verify_winternitz_signatures_aux::<String>(
verify_winternitz_signatures_aux::<String>(
wt_dispute_key,
&keys.to_vec(),
sign_mode,
true,
Some(vec![validate_slot_id, validate_pegout_id]),
)?;

// This block could be inside verify_winternitz_signatures_aux
protocol_script.add_stack_item(StackItem::new_schnorr_sig(true));
for (_, key) in keys {
protocol_script.add_stack_item(StackItem::new_winternitz_sig(&key));
}

Ok(protocol_script)
)
}

pub fn cosign_script(
Expand Down Expand Up @@ -147,21 +139,13 @@ pub fn cosign_script(
));
}

let mut protocol_script = verify_winternitz_signatures_aux::<String>(
verify_winternitz_signatures_aux::<String>(
op_dispute_key,
&keys,
sign_mode,
true,
Some(validate_cosign),
)?;

// This block could be inside verify_winternitz_signatures_aux
protocol_script.add_stack_item(StackItem::new_schnorr_sig(true));
for (_, key) in keys {
protocol_script.add_stack_item(StackItem::new_winternitz_sig(&key));
}

Ok(protocol_script)
)
}

fn get_stack_equality_script(words: u32) -> ScriptBuf {
Expand Down
2 changes: 1 addition & 1 deletion tests/test_gc_drp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ fn test_aux(
SignMode::Aggregate,
)];

let protocol_cost = 26_000;
let protocol_cost = 12_000;
let (utxo, initial_out_type) = init_utxo_new(
&mut helper.wallet,
&pair_0_1_agg_pub_key,
Expand Down
Loading