Documentation ¶
Index ¶
- type BalanceRecord
- type Credential
- func (_ *Credential) CanMarshalMsg(z interface{}) bool
- func (_ *Credential) CanUnmarshalMsg(z interface{}) bool
- func (cred Credential) Equals(otherCred Credential) bool
- func (cred Credential) Less(otherCred Credential) bool
- func (cred Credential) LowestOutputDigest() crypto.Digest
- func (z *Credential) MarshalMsg(b []byte) (o []byte)
- func (z *Credential) MsgIsZero() bool
- func (z *Credential) Msgsize() (s int)
- func (cred Credential) Selected() bool
- func (z *Credential) UnmarshalMsg(bts []byte) (o []byte, err error)
- type Membership
- type Seed
- func (_ *Seed) CanMarshalMsg(z interface{}) bool
- func (_ *Seed) CanUnmarshalMsg(z interface{}) bool
- func (z *Seed) MarshalMsg(b []byte) (o []byte)
- func (z *Seed) MsgIsZero() bool
- func (z *Seed) Msgsize() (s int)
- func (s Seed) ToBeHashed() (protocol.HashID, []byte)
- func (z *Seed) UnmarshalMsg(bts []byte) (o []byte, err error)
- type Selector
- type UnauthenticatedCredential
- func (_ *UnauthenticatedCredential) CanMarshalMsg(z interface{}) bool
- func (_ *UnauthenticatedCredential) CanUnmarshalMsg(z interface{}) bool
- func (z *UnauthenticatedCredential) MarshalMsg(b []byte) (o []byte)
- func (z *UnauthenticatedCredential) MsgIsZero() bool
- func (z *UnauthenticatedCredential) Msgsize() (s int)
- func (z *UnauthenticatedCredential) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (cred UnauthenticatedCredential) Verify(proto config.ConsensusParams, m Membership) (res Credential, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BalanceRecord ¶
type BalanceRecord struct { basics.OnlineAccountData Addr basics.Address }
BalanceRecord pairs an account's address with its associated data.
This struct is used to decouple LedgerReader.AccountData from basics.BalanceRecord.
basics.BalanceRecord에서 LedgerReader.AccountData를 분리시키기 위해 사용되는 구조체 온라인 계정정보와 그 주소값을 가지고 있다.
type Credential ¶
type Credential struct { // 제안자 혹은 투표자로 선출여부를 판단하기 위한 값 Weight uint64 `codec:"wt"` // RawOut crypto.VrfOutput의 해시값. VrfOut crypto.Digest `codec:"h"` // 설정값 중에 하나. 이미 설정된 값을 사용한다. DomainSeparationEnabled bool `codec:"ds"` // Hashable hashableCredential `codec:"hc"` // 아직 권한을 받지 않은 자격증 UnauthenticatedCredential // contains filtered or unexported fields }
A Credential represents a proof of committee membership.
The multiplicity of this membership is specified in the Credential's weight. The VRF output hash (with the owner's address hashed in) is also cached.
Upgrades: whether or not domain separation is enabled is cached. If this flag is set, this flag also includes original hashable credential.
Credential은 위원회의 멤버십의 증명을 나타낸다. weight가 0이상이면 선택이 된것이다(블록제안 혹은 투표 참여겠지?) VRF output hash 또한 캐싱된다.
func (*Credential) CanMarshalMsg ¶
func (_ *Credential) CanMarshalMsg(z interface{}) bool
func (*Credential) CanUnmarshalMsg ¶
func (_ *Credential) CanUnmarshalMsg(z interface{}) bool
func (Credential) Equals ¶
func (cred Credential) Equals(otherCred Credential) bool
Equals compares the hash of two Credentials to determine equality and returns true if they're equal.
func (Credential) Less ¶
func (cred Credential) Less(otherCred Credential) bool
Less returns true if this Credential is less than the other credential; false otherwise (i.e., >=). Used for breaking ties when there are multiple proposals.
Precondition: both credentials have nonzero weight
func (Credential) LowestOutputDigest ¶
func (cred Credential) LowestOutputDigest() crypto.Digest
LowestOutputDigest gives the lowestOutput as a crypto.Digest, which allows pretty-printing a proposal's lowest output. This function is only used for debugging.
func (*Credential) MarshalMsg ¶
func (z *Credential) MarshalMsg(b []byte) (o []byte)
MarshalMsg implements msgp.Marshaler
func (*Credential) MsgIsZero ¶
func (z *Credential) MsgIsZero() bool
MsgIsZero returns whether this is a zero value
func (*Credential) Msgsize ¶
func (z *Credential) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (Credential) Selected ¶
func (cred Credential) Selected() bool
Selected returns whether this Credential was selected (i.e., if its weight is greater than zero).
func (*Credential) UnmarshalMsg ¶
func (z *Credential) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type Membership ¶
type Membership struct { Record BalanceRecord // Selector는 제안자 및 투표위원회를 선택하기 위한 객체이다. Selector Selector // 라운드가 끝날 때 보유하고 있는 총 알고양 TotalMoney basics.MicroNovas }
Membership encodes the parameters used to verify membership in a committee.
Membership구조체는 위원회의 멤버라는 것을 증명하기 위해 사용되는 파라미터를 인코딩한 결과(?)
type Seed ¶
type Seed [32]byte
A Seed contains cryptographic entropy which can be used to determine a committee.
위원회 선정 시 사용되는 SEED값
func (*Seed) CanMarshalMsg ¶
func (*Seed) CanUnmarshalMsg ¶
func (*Seed) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (*Seed) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (Seed) ToBeHashed ¶
ToBeHashed implements the crypto.Hashable interface
type Selector ¶
type Selector interface { // The hash of a struct which implements Selector is used as the input // to the VRF. // Selector 인터페이스를 구현하는 구조체의 해시값 crypto.Hashable // CommitteeSize returns the size of the committee determined by this // Selector. /* 이 셀렉터에 의해 결정된 위원회의 수 */ CommitteeSize(config.ConsensusParams) uint64 }
A Selector deterministically defines a cryptographic sortition committee. It contains both the input to the sortition VRF and the size of the sortition committee.
Selector는 결정적으로(뭐가 결정적?) 위원회를 정의한다. 추첨 VFR 인풋과 위원회의 사이즈 정보를 가지고 있다.
type UnauthenticatedCredential ¶
type UnauthenticatedCredential struct { // vrf 검증 시 사용되는 증명값 Proof crypto.VrfProof `codec:"pf"` // contains filtered or unexported fields }
An UnauthenticatedCredential is a Credential which has not yet been authenticated.
UnauthenticatedCredential은 아직 권한을 받지 않은 자격증이다.
func MakeCredential ¶
func MakeCredential(secrets *crypto.VrfPrivkey, sel Selector) UnauthenticatedCredential
MakeCredential creates a new unauthenticated Credential given some selector.
주어진 selector로부터 새로운 unauthenticated Credential를 생성한다.
func (*UnauthenticatedCredential) CanMarshalMsg ¶
func (_ *UnauthenticatedCredential) CanMarshalMsg(z interface{}) bool
func (*UnauthenticatedCredential) CanUnmarshalMsg ¶
func (_ *UnauthenticatedCredential) CanUnmarshalMsg(z interface{}) bool
func (*UnauthenticatedCredential) MarshalMsg ¶
func (z *UnauthenticatedCredential) MarshalMsg(b []byte) (o []byte)
MarshalMsg implements msgp.Marshaler
func (*UnauthenticatedCredential) MsgIsZero ¶
func (z *UnauthenticatedCredential) MsgIsZero() bool
MsgIsZero returns whether this is a zero value
func (*UnauthenticatedCredential) Msgsize ¶
func (z *UnauthenticatedCredential) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*UnauthenticatedCredential) UnmarshalMsg ¶
func (z *UnauthenticatedCredential) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
func (UnauthenticatedCredential) Verify ¶
func (cred UnauthenticatedCredential) Verify(proto config.ConsensusParams, m Membership) (res Credential, err error)
Verify an unauthenticated Credential that was received from the network.
Verify checks if the given credential is a valid proof of membership conditioned on the provided committee membership parameters.
If it is, the returned Credential constitutes a proof of this fact. Otherwise, an error is returned.
네트워크에서 수신한 unauthenticated Credential 검증합니다. 제공된 unauthenticated Credential이 유효한 멤버십 proof인지 확인합니다. 유효하다면 Credential을 반환하고 그렇지 않으면 오류가 반환됩니다.