diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2018-09-17 17:43:56 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-17 17:43:56 +0800 |
commit | cbf0012603deb6d2b8c257c079de98792f7b84cf (patch) | |
tree | 10294191481d4b7516ef0bc089bca1ebf1aa705c /core/types/dkg.go | |
parent | 874c4c599a80b9c6f9c085c216be5fd6492cd2c2 (diff) | |
download | dexon-consensus-cbf0012603deb6d2b8c257c079de98792f7b84cf.tar dexon-consensus-cbf0012603deb6d2b8c257c079de98792f7b84cf.tar.gz dexon-consensus-cbf0012603deb6d2b8c257c079de98792f7b84cf.tar.bz2 dexon-consensus-cbf0012603deb6d2b8c257c079de98792f7b84cf.tar.lz dexon-consensus-cbf0012603deb6d2b8c257c079de98792f7b84cf.tar.xz dexon-consensus-cbf0012603deb6d2b8c257c079de98792f7b84cf.tar.zst dexon-consensus-cbf0012603deb6d2b8c257c079de98792f7b84cf.zip |
core: DKG interface (#108)
Diffstat (limited to 'core/types/dkg.go')
-rw-r--r-- | core/types/dkg.go | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/core/types/dkg.go b/core/types/dkg.go new file mode 100644 index 0000000..7fee404 --- /dev/null +++ b/core/types/dkg.go @@ -0,0 +1,47 @@ +// Copyright 2018 The dexon-consensus-core Authors +// This file is part of the dexon-consensus-core library. +// +// The dexon-consensus-core library is free software: you can redistribute it +// and/or modify it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation, either version 3 of the License, +// or (at your option) any later version. +// +// The dexon-consensus-core library is distributed in the hope that it will be +// useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser +// General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with the dexon-consensus-core library. If not, see +// <http://www.gnu.org/licenses/>. + +package types + +import ( + "github.com/dexon-foundation/dexon-consensus-core/crypto" + "github.com/dexon-foundation/dexon-consensus-core/crypto/dkg" +) + +// DKGPrivateShare describe a secret share in DKG protocol. +type DKGPrivateShare struct { + ProposerID ValidatorID `json:"proposer_id"` + Round uint64 `json:"round"` + PrivateKeyShare dkg.PrivateKey `json:"private_key_share"` + Signature crypto.Signature `json:"signature"` +} + +// DKGMasterPublicKey decrtibe a master public key in DKG protocol. +type DKGMasterPublicKey struct { + ProposerID ValidatorID `json:"proposer_id"` + Round uint64 `json:"round"` + PublicKeyShares dkg.PublicKeyShares `json:"private_key_share"` + Signature crypto.Signature `json:"signature"` +} + +// DKGComplaint describe a complaint in DKG protocol. +type DKGComplaint struct { + ProposerID ValidatorID `json:"proposer_id"` + Round uint64 `json:"round"` + PrivateShare DKGPrivateShare `json:"private_share"` + Signature crypto.Signature `json:"signature"` +} |