MCPcopy Create free account
hub / github.com/BitVM/BitVM / generate_taproot_leaf_0_script

Method generate_taproot_leaf_0_script

bridge/src/connectors/connector_2.rs:49–67  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

47 }
48
49 fn generate_taproot_leaf_0_script(&self) -> ScriptBuf {
50 let start_time_public_key = &self.commitment_public_keys[&CommitmentMessageId::StartTime];
51
52 script! {
53 // pre-image (pushed to stack from witness)
54 // BITVM1 opcodes
55 // block peg out was mined in (left on stack)
56
57 // TODO(LucidLuckylee): If there is a Winternitz Converter to generate the 32byte number implemented use it here and
58 // get rid of the extra conversion with bytes_to_number.
59 { winternitz_message_checksig(start_time_public_key) }
60 { digits_to_number::<{ START_TIME_MESSAGE_LENGTH * 2}, { LOG_D as usize }>() }
61 OP_CLTV
62 OP_DROP
63 { self.operator_taproot_public_key }
64 OP_CHECKSIG
65 }
66 .compile()
67 }
68
69 fn generate_taproot_leaf_0_tx_in(&self, input: &Input) -> TxIn {
70 generate_timelock_tx_in(input, N_SEQUENCE_FOR_LOCK_TIME)

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected