Created
October 17, 2022 15:10
-
-
Save jasny/8273ce6f1b67dec4f654b82ba332ec0c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define public keys | |
let alicePubKey = base58'5AzfA9UfpWVYiwFwvdr77k6LWupSTGLb14b24oVdEpMM' | |
let bobPubKey = base58'2KwU4vzdgPmKyf7q354H9kSyX9NZjNiq4qbnH2wi2VDF' | |
let cooperPubKey = base58'GbrUeGaBfmyFJjSQb9Z8uTCej5GzjXfRDVGJGrmgt5cD' | |
#check whoever provided the valid proof | |
let aliceSigned = if (sigVerify(tx.bodyBytes, tx.proofs[0], alicePubKey ) || sigVerify(tx.bodyBytes, tx.proofs[1], alicePubKey )) then 1 else 0 | |
let bobSigned = if (sigVerify(tx.bodyBytes, tx.proofs[0], bobPubKey ) || sigVerify(tx.bodyBytes, tx.proofs[1], bobPubKey )) then 1 else 0 | |
let cooperSigned = if (sigVerify(tx.bodyBytes, tx.proofs[0], cooperPubKey) || sigVerify(tx.bodyBytes, tx.proofs[1], cooperPubKey)) then 1 else 0 | |
#sum up every valid proof to get at least 2 | |
aliceSigned + bobSigned + cooperSigned >= 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment