forked from onflow/flow-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dkg.go
27 lines (21 loc) · 777 Bytes
/
dkg.go
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
package protocol
import (
"github.com/onflow/flow-go/crypto"
"github.com/onflow/flow-go/model/flow"
)
// DKG represents the result of running the distributed key generation
// procedure for the random beacon.
type DKG interface {
// Size is the number of members in the DKG.
Size() uint
// GroupKey is the group public key.
GroupKey() crypto.PublicKey
// Index returns the index for the given node.
// Error Returns:
// * protocol.IdentityNotFoundError if nodeID is not a valid DKG participant.
Index(nodeID flow.Identifier) (uint, error)
// KeyShare returns the public key share for the given node.
// Error Returns:
// * protocol.IdentityNotFoundError if nodeID is not a valid DKG participant.
KeyShare(nodeID flow.Identifier) (crypto.PublicKey, error)
}