When building keysets, they have three options: keys-all, keys-2, and keys-any. I wanted to create a keyset that required 3 keys to sign the transaction, but I was confused about how to force the keyset to take all three keys in the signature section.
Asked
Active
Viewed 50 times
1 Answers
1
The validity of the keyset is checked through the predicate (pred). The predicate can be any function that is fed as arguments:
- the number of keys in the keyset
- the count of matching signatures
If the predicate returns true the transaction can continue. You can construct custom predicates matching this function signature:
(defun keys-3:bool(count:integer matched:integer)
(>= matched 3))
And then create a keyset using that custom predicate:
(env-data {
"my-keyset": {"keys": ["bob", "alice", "babena" ],
"pred": "my-module.keys-3"}
})

georgep
- 731
- 1
- 12