pub(super) fn post_code_sep(
        builder: Builder,
        h: [u8; 20],
        redeem_pk: bitcoin::PublicKey,
    ) -> Builder {
        let builder = hash_verify(builder, h);
        // pub pubkey
        assert!(redeem_pk.compressed);
        let builder = builder.push_key(&redeem_pk);

        // Post script
        let builder = builder
            .push_int(2)
            .push_opcode(OP_PICK)
            .push_int(1)
            .push_opcode(OP_CAT)
            .push_opcode(OP_OVER)
            .push_opcode(OP_CHECKSIGVERIFY)
            .push_opcode(OP_SWAP)
            .push_opcode(OP_SHA256)
            .push_opcode(OP_SWAP)
            .push_opcode(OP_CHECKSIGFROMSTACK);
        builder
    }
// Given a script before OP_CODESEP, construct the script after it
// Assumes the stack structure as
// [sig sighash pk pre]
// We have verified all the covenant logic. Now we only need to verify
// the sighash was constructed correctly.
Given a script before OP_CODESEP, construct the script after it
Assumes the stack structure as
[sig sighash pk pre]
We have verified all the covenant logic. Now we only need to verify
the sighash was constructed correctly.
Given a script before OP_CODESEP construct the script after it Assumes the stack structure as [ sig sighash pk pre ] We have verified all the covenant logic . Now we only need to verify the sighash was constructed correctly .
pub(super) fn post_code_sep(
        builder: Builder,
        h: [u8; 20],
        redeem_pk: bitcoin::PublicKey,
    ) -> Builder {
        let builder = hash_verify(builder, h);
        // pub pubkey
        assert!(redeem_pk.compressed);
        let builder = builder.push_key(&redeem_pk);
        // Post script
        let builder = builder
            .push_int(2)
            .push_opcode(OP_PICK)
            .push_int(1)
            .push_opcode(OP_CAT)
            .push_opcode(OP_OVER)
            .push_opcode(OP_CHECKSIGVERIFY)
            .push_opcode(OP_SWAP)
            .push_opcode(OP_SHA256)
            .push_opcode(OP_SWAP)
            .push_opcode(OP_CHECKSIGFROMSTACK);
        builder
    }
pub ( super ) fn post_code_sep ( builder : Builder , h : [ u8 ; 20 ] , redeem_pk : bitcoin :: PublicKey , ) -> Builder { let builder = hash_verify ( builder , h ) ; // pub pubkey assert ! ( redeem_pk compressed ) ; let builder = builder . push_key ( & redeem_pk ) ; // Post script let builder = builder . push_int ( 2 ) . push_opcode ( OP_PICK ) . push_int ( 1 ) . push_opcode ( OP_CAT ) . push_opcode ( OP_OVER ) . push_opcode ( OP_CHECKSIGVERIFY ) . push_opcode ( OP_SWAP ) . push_opcode ( OP_SHA256 ) . push_opcode ( OP_SWAP ) . push_opcode ( OP_CHECKSIGFROMSTACK ) ; builder }
Given a script before OP_CODESEP, construct the script after it
Assumes the stack structure as
[sig sighash pk pre]
We have verified all the covenant logic.
Given a script before OP_CODESEP construct the script after it Assumes the stack structure as [ sig sighash pk pre ] We have verified all the covenant logic .
builder
Builder
h
[u8; 20]
redeem_pk
bitcoin::PublicKey
builder
Builder
h
[u8; 20]
redeem_pk
bitcoin::PublicKey