Skip to content

Commit

Permalink
Remove operator publickey from kickoff utxo timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
atacann committed Jan 16, 2025
1 parent 1cb5f99 commit 91b17e6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 9 additions & 0 deletions core/src/builder/script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@ pub fn generate_relative_timelock_script(
.into_script()
}

pub fn generate_relative_timelock_script_no_key(block_count: i64) -> ScriptBuf {
Builder::new()
.push_int(block_count)
.push_opcode(OP_CSV)
.push_opcode(OP_DROP)
.push_opcode(OP_TRUE)
.into_script()
}

pub fn actor_with_preimage_script(
actor_taproot_xonly_pk: XOnlyPublicKey,
hash: &[u8; 20],
Expand Down
6 changes: 3 additions & 3 deletions core/src/builder/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ pub fn create_sequential_collateral_txhandler(
);

let timeout_block_count_locked_script =
builder::script::generate_relative_timelock_script(operator_xonly_pk, timeout_block_count);
builder::script::generate_relative_timelock_script_no_key(timeout_block_count);

let (op_address, op_spend) = create_taproot_address(&[], Some(operator_xonly_pk), network);
let (reimburse_gen_connector, reimburse_gen_spend) =
Expand Down Expand Up @@ -744,7 +744,7 @@ pub fn create_assert_end_txhandler(
builder::script::generate_relative_timelock_script(nofn_xonly_pk, 2 * 7 * 24 * 6);
let (connector_addr, connector_spend) = builder::address::create_taproot_address(
&[nofn_1week.clone(), nofn_2week.clone()],
Some(*UNSPENDABLE_XONLY_PUBKEY),
None,
network,
);
let tx_outs = vec![
Expand Down Expand Up @@ -1117,7 +1117,7 @@ pub fn create_kickoff_timeout_txhandler(
vout: 0,
},
]);
let (dust_address, _) = create_taproot_address(&[], Some(*UNSPENDABLE_XONLY_PUBKEY), network);
let (dust_address, _) = create_taproot_address(&[], None, network);
let dust_output = TxOut {
value: Amount::from_sat(330),
script_pubkey: dust_address.script_pubkey(),
Expand Down

0 comments on commit 91b17e6

Please sign in to comment.