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

Function lock_script_cache_id

bridge/src/connectors/connector_c.rs:271–279  ·  view source on GitHub ↗
(
    commitment_public_keys: &BTreeMap<CommitmentMessageId, WinternitzPublicKey>,
    leaf_index: usize,
)

Source from the content-addressed store, hash-verified

269}
270
271fn lock_script_cache_id(
272 commitment_public_keys: &BTreeMap<CommitmentMessageId, WinternitzPublicKey>,
273 leaf_index: usize,
274) -> String {
275 let mut bytes = first_winternitz_public_key_bytes(commitment_public_keys);
276 bytes.append(leaf_index.to_be_bytes().to_vec().as_mut());
277 let hash = hash160::Hash::hash(&bytes);
278 hash.as_byte_array().to_lower_hex_string()
279}
280
281fn generate_script_and_control_block(
282 operator_taproot_public_key: XOnlyPublicKey,

Callers 1

Calls 2

appendMethod · 0.45

Tested by

no test coverage detected