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
2 changes: 1 addition & 1 deletion goat/src/assert_scripts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub fn verify_prover_assert_script_768_wire(
prover_wots_pubkey: &<Wots96 as Wots>::PublicKey,
) -> Script {
script! {
OP_DROP
OP_2DROP
{ Wots96::checksig_verify_and_clear_stack(prover_wots_pubkey) }
OP_TRUE
}
Expand Down
11 changes: 7 additions & 4 deletions goat/src/connectors/connector_c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,22 @@ impl ConnectorC {
&self,
sk: &OperatorAssertSecretKey,
proof: &[u8; 96],
extra_data: &[u8],
pi2: &[u8],
pi3: &[u8],
) -> Result<Vec<Vec<u8>>, Error> {
let witness = Wots96::sign_to_raw_witness(sk, proof);
let witness_script = script! {
{ witness.clone() }
{ extra_data.to_vec() }
{ pi2.to_vec() }
{ pi3.to_vec() }
};
let verification_script = witness_script.push_script(self.generate_taproot_leaf_1_script());
let exec_result = execute_script(verification_script);
match exec_result.success {
true => {
let mut unlock_data = witness.to_vec();
unlock_data.push(extra_data.to_vec());
unlock_data.push(pi2.to_vec());
unlock_data.push(pi3.to_vec());
Ok(unlock_data)
}
false => Err(Error::Other("Invalid WOTS secret-key for Connector-C.")),
Expand All @@ -75,7 +78,7 @@ impl ConnectorC {

pub fn extract_leaf_1_raw_witness(&self, txin: &TxIn) -> Result<RawWitness, Error> {
let witness = txin.witness.to_vec();
if witness.len() != PROVER_SIG_LEN + 3 {
if witness.len() != PROVER_SIG_LEN + 4 {
return Err(Error::Other(
"Invalid witness length for Connector-C leaf 1.",
));
Expand Down
5 changes: 3 additions & 2 deletions goat/src/transactions/assert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,12 @@ impl OperatorAssertTransaction {
wots_sk: &OperatorAssertSecretKey,
connector_c: &ConnectorC,
proof: &[u8; 96],
extra_data: &[u8],
pi2: &[u8],
pi3: &[u8],
) -> Result<(), Error> {
let input_index = 0;
let leaf_index = 1;
match connector_c.generate_leaf_1_unlock_data(wots_sk, proof, extra_data) {
match connector_c.generate_leaf_1_unlock_data(wots_sk, proof, pi2, pi3) {
Ok(wit) => {
populate_taproot_input_witness(
self.tx_mut(),
Expand Down
Loading