# Validator

# What is Validator?

Validator is a full node that participates in the consensus mechanism by broadcasting its votes. Validators get rewards for proposing new blocks. Validators should bond tokens in the form of stake and they are weighted by their boned stakes.

# Validator structure

Validator structure is used to hold the public key, stake and number of validators.

type Validator struct {
   PublicKey        PublicKey `cbor:"1,keyasint"`
   Number           int       `cbor:"2,keyasint"`
   Sequence         int       `cbor:"3,keyasint"`
   Stake            int64     `cbor:"4,keyasint"`
   BondingHeight    int       `cbor:"5,keyasint"`
   UnbondingHeight  int       `cbor:"6,keyasint"`
   LastJoinedHeight int       `cbor:"7,keyasint"`
}
  • PublicKey is the public key of validator which is 96 bytes in length
  • Number is a unique and sequential number for the validator
  • Sequence increasers anytime user send a transactions to prevent replaying the transaction
  • Stake holds the stake of the validator
  • BondingHeight is the last height that the validator is bonded some stake
  • UnbondingHeight is the height that the validator is unbonded
  • LastJoinedHeight is the validator joined the committee

# Example

Hers is an example of a validator data:

000000   A7 01 58 60 59 4A C3 8E  E3 89 49 35 6E 13 93 40   §.X`YJÃ.ã.I5n..@
000010   CD 96 68 F4 8D 90 8E 76  B4 47 81 E7 01 3E 3F 70   Í.hô...v´G.ç.>?p
000020   B7 38 A9 B6 B5 3E 95 DF  CB A2 3B D1 BB E9 23 D2   ·8©¶µ>.ßË¢;Ñ»é#Ò
000030   DF 35 48 15 98 66 43 46  7F 25 B7 55 D7 6A 90 8C   ß5H..fCF.%·U×j..
000040   0D CA 20 32 7C C1 11 E1  6D 30 F3 70 41 A2 34 17   .Ê 2|Á.ám0ópA¢4.
000050   F8 D7 CB 44 6C C8 91 C5  51 17 6D F6 41 F0 7C 1F   ø×ËDlÈ.ÅQ.möAð|.
000060   4E 1E 06 8B 02 00 03 00  04 00 05 00 06 00 07 00   N...............

Which can be interpreted in CBOR (opens new window) format:

{
    1: h'594AC38EE38949356E139340CD9668F48D908E76B44781E7013E3F70B738A9B6B53E95DFCBA23BD1BBE923D2DF354815986643467F25B755D76A908C0DCA20327CC111E16D30F37041A23417F8D7CB446CC891C551176DF641F07C1F4E1E068B',
    2: 0,
    3: 0,
    4: 0,
    5: 0,
    6: 0,
    7: 0
}

Validator Hash is the hash of the validator in binary format. For this example the validator hash is:

0xe31bf5a07ce7264cac6e9d4e3a071a4fcf92628b101c13f2e97cd7c34066b308