Skip to main content
1 of 2
Ava Chow
  • 72.2k
  • 5
  • 84
  • 162

Your pseudocode is close, but not quite right. This is correct:

bool pk_script(dat1, dat2, sig1, sig2) {
    if (sha256(dat1) == hash1 &&
        sha256(dat2) == hash2 &&
        size(dat1) == 32 or 33 &&
        size(dat2) == 32 or 33) {
        return size(dat1) == size(dat2)
    } else {
        return checksig(sig1, pk1) && checksig(sig2, pk2);
    }
}

Basically it is looking for either two hash preimages that match the provided hashes and are the same length of either 32 or 33 bytes, or it needs two signatures that match the provided two public keys.

Ava Chow
  • 72.2k
  • 5
  • 84
  • 162