Interface CompositeKeyGenerator
-
- All Implemented Interfaces:
public interface CompositeKeyGenerator
A generator for a tree data structure that enables the representation of composite public keys, which are used to represent the signing requirements for multi-signature scenarios. A composite key is a list of leaf keys and their contributing weight, and each leaf can be a conventional single key or a composite key. Keys contribute their weight to the total if they are matched by the signature.
For complex scenarios, such as "Both Alice and Bob need to sign to consume a state S", we can represent the requirement by creating a tree with a root CompositeKey, and Alice and Bob as children. The root node would specify weights for each of its children and a threshold – the minimum total weight required (for example, the minimum number of child signatures required) to satisfy the tree signature requirement.
Using these constructs we can express, for example, one of N (OR) or N of N (AND) signature requirements. By nesting we can create multilevel requirements such as "Either the CEO or three of five of his assistants need to sign".
Composite key implementations will track the minimum total weight required (in the simple case – the minimum number of child signatures required) to satisfy the subtree rooted at this node.
-
-
Method Summary
Modifier and Type Method Description abstract PublicKey
create(@NotNull() List<CompositeKeyNodeAndWeight> keys, @Nullable() Integer threshold)
Return a composite key from a weighted list of keys, and an overall threshold. -
-
Method Detail
-
create
@NotNull() abstract PublicKey create(@NotNull() List<CompositeKeyNodeAndWeight> keys, @Nullable() Integer threshold)
Return a composite key from a weighted list of keys, and an overall threshold.
- Parameters:
keys
- A list of keys, each which its own weight.threshold
- The threshold of total weights of keys that can be validated.
-
-
-
-