Documentation ¶
Index ¶
- type ThresholdSigner
- func (ts *ThresholdSigner) CalculateSignatureShare(message *bn256.G1) *bn256.G1
- func (ts *ThresholdSigner) CompleteSignature(signatureShares []*bls.SignatureShare, honestThreshold int) (*bn256.G1, error)
- func (ts *ThresholdSigner) GroupPublicKeyBytes() []byte
- func (ts *ThresholdSigner) GroupPublicKeyBytesCompressed() []byte
- func (ts *ThresholdSigner) GroupPublicKeyShares() map[group.MemberIndex]*bn256.G2
- func (ts *ThresholdSigner) Marshal() ([]byte, error)
- func (ts *ThresholdSigner) MemberID() group.MemberIndex
- func (ts *ThresholdSigner) Unmarshal(bytes []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ThresholdSigner ¶
type ThresholdSigner struct {
// contains filtered or unexported fields
}
ThresholdSigner is created from GJKR group Member when DKG protocol completed successfully and each group member is ready to sign. ThresholdSigner contains its own private key share of group public key that should never be publicly revealed. It also contains group's public key and ID of GJKR Member represented by this ThresholdSigner instance.
func ExecuteDKG ¶
func ExecuteDKG( seed *big.Int, index uint8, groupSize int, dishonestThreshold int, membershipValidator group.MembershipValidator, startBlockHeight uint64, blockCounter chain.BlockCounter, relayChain relayChain.Interface, signing chain.Signing, channel net.BroadcastChannel, ) (*ThresholdSigner, error)
ExecuteDKG runs the full distributed key generation lifecycle.
func NewThresholdSigner ¶
func NewThresholdSigner( memberIndex group.MemberIndex, groupPublicKey *bn256.G2, groupPrivateKeyShare *big.Int, groupPublicKeyShares map[group.MemberIndex]*bn256.G2, ) *ThresholdSigner
NewThresholdSigner returns a new ThresholdSigner
func (*ThresholdSigner) CalculateSignatureShare ¶
func (ts *ThresholdSigner) CalculateSignatureShare(message *bn256.G1) *bn256.G1
CalculateSignatureShare takes the message and calculates signer's signature share over that message.
func (*ThresholdSigner) CompleteSignature ¶
func (ts *ThresholdSigner) CompleteSignature( signatureShares []*bls.SignatureShare, honestThreshold int, ) (*bn256.G1, error)
CompleteSignature accepts signature shares from all group threshold signers and produces a final group signature from them. Input slice should contain signature of the current signer as well. We parameterize the threshold (number of honest members we require), as we recover a threshold signature, not an aggregate signature (one which would require all members).
func (*ThresholdSigner) GroupPublicKeyBytes ¶
func (ts *ThresholdSigner) GroupPublicKeyBytes() []byte
GroupPublicKeyBytes returns group public key bytes in an uncompressed form.
func (*ThresholdSigner) GroupPublicKeyBytesCompressed ¶
func (ts *ThresholdSigner) GroupPublicKeyBytesCompressed() []byte
GroupPublicKeyBytesCompressed returns group public key bytes in a compressed form.
func (*ThresholdSigner) GroupPublicKeyShares ¶
func (ts *ThresholdSigner) GroupPublicKeyShares() map[group.MemberIndex]*bn256.G2
GroupPublicKeyShares returns group public key shares for each individual member of the group.
func (*ThresholdSigner) Marshal ¶
func (ts *ThresholdSigner) Marshal() ([]byte, error)
Marshal converts ThresholdSigner to byte array.
func (*ThresholdSigner) MemberID ¶
func (ts *ThresholdSigner) MemberID() group.MemberIndex
MemberID returns GJKR MemberID represented by this ThresholdSigner.
func (*ThresholdSigner) Unmarshal ¶
func (ts *ThresholdSigner) Unmarshal(bytes []byte) error
Unmarshal converts a byte array back to ThresholdSigner.