forked from rink1969/ckb-contract-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtwo_of_two.c
More file actions
32 lines (27 loc) · 794 Bytes
/
two_of_two.c
File metadata and controls
32 lines (27 loc) · 794 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "secp256k1_blake160.h"
// two of two multi signature
int main(int argc, char* argv[])
{
int ret;
uint64_t length = 0;
if (argc == 9) {
// signed args:
// arg[1] alice pubkey hash
// arg[2] bob pubkey hash
// witnesses:
// arg[3] alice pubkey
// arg[4] alice signature
// arg[5] alice signature size
// arg[6] bob pubkey
// arg[7] bob signature
// arg[8] bob signature size
length = *((uint64_t *) argv[5]);
ret = verify_sighash_all(argv[1], argv[3], argv[4], length);
if (ret != CKB_SUCCESS) {
return ret;
}
length = *((uint64_t *) argv[8]);
return verify_sighash_all(argv[2], argv[6], argv[7], length);
}
return -99;
}