github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/state/protocol/dkg.go (about)

     1  package protocol
     2  
     3  import (
     4  	"github.com/onflow/crypto"
     5  
     6  	"github.com/onflow/flow-go/model/flow"
     7  )
     8  
     9  // DKG represents the result of running the distributed key generation
    10  // procedure for the random beacon.
    11  type DKG interface {
    12  
    13  	// Size is the number of members in the DKG.
    14  	Size() uint
    15  
    16  	// GroupKey is the group public key.
    17  	GroupKey() crypto.PublicKey
    18  
    19  	// Index returns the index for the given node.
    20  	// Error Returns:
    21  	// * protocol.IdentityNotFoundError if nodeID is not a valid DKG participant.
    22  	Index(nodeID flow.Identifier) (uint, error)
    23  
    24  	// KeyShare returns the public key share for the given node.
    25  	// Error Returns:
    26  	// * protocol.IdentityNotFoundError if nodeID is not a valid DKG participant.
    27  	KeyShare(nodeID flow.Identifier) (crypto.PublicKey, error)
    28  }