[project] Bls -> BLS & remove dead Stake solidity contract (#2652)

pull/2653/head
Edgar Aroutiounian 5 years ago committed by GitHub
parent 2df20124e1
commit f8cbd880bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      api/service/metrics/service.go
  2. 2
      cmd/client/txgen/main.go
  3. 42
      cmd/client/wallet/main.go
  4. 36
      cmd/harmony/main.go
  5. 8
      consensus/consensus.go
  6. 14
      consensus/consensus_service.go
  7. 8
      consensus/fbft_log.go
  8. 10
      consensus/quorum/one-node-staked-vote.go
  9. 10
      consensus/quorum/one-node-staked-vote_test.go
  10. 6
      consensus/quorum/quorum.go
  11. 20
      consensus/votepower/roster.go
  12. 6
      consensus/votepower/roster_test.go
  13. 10
      contracts/README.md
  14. 632
      contracts/StakeLockContract.go
  15. 148
      contracts/StakeLockContract.sol
  16. 1
      contracts/gen.sh
  17. 2
      core/blockchain.go
  18. 6
      core/rawdb/accessors_indexes_test.go
  19. 10
      core/staking_verifier_test.go
  20. 6
      core/tx_pool_test.go
  21. 6
      crypto/bls/bls.go
  22. 4
      drand/drand.go
  23. 2
      drand/drand_leader.go
  24. 12
      internal/blsgen/lib.go
  25. 4
      internal/blsgen/lib_test.go
  26. 4
      internal/chain/reward.go
  27. 4
      internal/configs/node/config.go
  28. 6
      internal/configs/node/config_test.go
  29. 4
      internal/configs/sharding/instance.go
  30. 5920
      internal/genesis/foundational.go
  31. 1840
      internal/genesis/foundational_pangaea.go
  32. 4
      internal/genesis/genesis.go
  33. 8
      internal/genesis/genesis_test.go
  34. 1608
      internal/genesis/harmony.go
  35. 61
      internal/genesis/keys.py
  36. 104
      internal/genesis/localnodes.go
  37. 20
      internal/genesis/newnodes.go
  38. 160
      internal/genesis/pangaea.go
  39. 2400
      internal/genesis/tn_harmony.go
  40. 8
      internal/hmyapi/apiv1/blockchain.go
  41. 8
      internal/hmyapi/apiv2/blockchain.go
  42. 10
      internal/utils/utils.go
  43. 2
      node/node_handler.go
  44. 4
      node/node_resharding.go
  45. 6
      p2p/p2p.go
  46. 4
      scripts/wallet.sh
  47. 14
      shard/committee/assignment.go
  48. 57
      shard/shard_state.go
  49. 13
      staking/availability/measure.go
  50. 4
      staking/effective/calculate.go
  51. 2
      staking/effective/calculate_test.go
  52. 2
      staking/slash/double-sign.go
  53. 8
      staking/slash/double-sign_test.go
  54. 6
      staking/types/messages.go
  55. 6
      staking/types/messages_test.go
  56. 6
      staking/types/transaction_test.go
  57. 18
      staking/types/validator.go
  58. 8
      staking/types/validator_test.go
  59. 10
      test/chain/reward/main.go
  60. 2
      test/crypto/bls/main.go

@ -30,7 +30,7 @@ const (
// Service is the struct for metrics service. // Service is the struct for metrics service.
type Service struct { type Service struct {
BlsPublicKey string BLSPublicKey string
IP string IP string
Port string Port string
PushgatewayIP string PushgatewayIP string
@ -88,7 +88,7 @@ var (
// New returns metrics service. // New returns metrics service.
func New(selfPeer *p2p.Peer, blsPublicKey, pushgatewayIP, pushgatewayPort string) *Service { func New(selfPeer *p2p.Peer, blsPublicKey, pushgatewayIP, pushgatewayPort string) *Service {
return &Service{ return &Service{
BlsPublicKey: blsPublicKey, BLSPublicKey: blsPublicKey,
IP: selfPeer.IP, IP: selfPeer.IP,
Port: selfPeer.Port, Port: selfPeer.Port,
PushgatewayIP: pushgatewayIP, PushgatewayIP: pushgatewayIP,
@ -124,7 +124,7 @@ func (s *Service) Run() {
registry := prometheus.NewRegistry() registry := prometheus.NewRegistry()
registry.MustRegister(blockHeightGauge, connectionsNumberGauge, nodeBalanceGauge, lastConsensusGauge, blockRewardGauge, blocksAcceptedGauge, txPoolGauge, isLeaderGauge) registry.MustRegister(blockHeightGauge, connectionsNumberGauge, nodeBalanceGauge, lastConsensusGauge, blockRewardGauge, blocksAcceptedGauge, txPoolGauge, isLeaderGauge)
s.pusher = push.New("http://"+s.PushgatewayIP+":"+s.PushgatewayPort, "node_metrics").Gatherer(registry).Grouping("instance", s.IP+":"+s.Port).Grouping("bls_key", s.BlsPublicKey) s.pusher = push.New("http://"+s.PushgatewayIP+":"+s.PushgatewayPort, "node_metrics").Gatherer(registry).Grouping("instance", s.IP+":"+s.Port).Grouping("bls_key", s.BLSPublicKey)
go s.PushMetrics() go s.PushMetrics()
} }

@ -109,7 +109,7 @@ func setUpTXGen() *node.Node {
pubs := []*bls2.PublicKey{} pubs := []*bls2.PublicKey{}
for _, acct := range genesis.HarmonyAccounts[startIdx:endIdx] { for _, acct := range genesis.HarmonyAccounts[startIdx:endIdx] {
pub := &bls2.PublicKey{} pub := &bls2.PublicKey{}
if err := pub.DeserializeHexStr(acct.BlsPublicKey); err != nil { if err := pub.DeserializeHexStr(acct.BLSPublicKey); err != nil {
fmt.Printf("Can not deserialize public key. err: %v", err) fmt.Printf("Can not deserialize public key. err: %v", err)
os.Exit(1) os.Exit(1)
} }

@ -116,12 +116,12 @@ var (
blsPass = blsrecoveryCommand.String("pass", "", "Passphrase to decrypt the bls file.") blsPass = blsrecoveryCommand.String("pass", "", "Passphrase to decrypt the bls file.")
blsFile = blsrecoveryCommand.String("file", "", "Non-human readable bls file.") blsFile = blsrecoveryCommand.String("file", "", "Non-human readable bls file.")
blsImportCommand = flag.NewFlagSet("importBls", flag.ExitOnError) blsImportCommand = flag.NewFlagSet("importBLS", flag.ExitOnError)
blsKey = blsImportCommand.String("key", "", "The raw private key.") blsKey = blsImportCommand.String("key", "", "The raw private key.")
getBlsPublicCommand = flag.NewFlagSet("getBlsPublic", flag.ExitOnError) getBLSPublicCommand = flag.NewFlagSet("getBLSPublic", flag.ExitOnError)
blsKey2 = getBlsPublicCommand.String("key", "", "The raw private key.") blsKey2 = getBLSPublicCommand.String("key", "", "The raw private key.")
blsFile2 = getBlsPublicCommand.String("file", "", "The encrypted bls file.") blsFile2 = getBLSPublicCommand.String("file", "", "The encrypted bls file.")
) )
var ( var (
@ -184,9 +184,9 @@ func main() {
fmt.Println(" 12. blsRecovery - Recover non-human readable file.") fmt.Println(" 12. blsRecovery - Recover non-human readable file.")
fmt.Println(" --pass - The file containg the passphrase to decrypt the bls key.") fmt.Println(" --pass - The file containg the passphrase to decrypt the bls key.")
fmt.Println(" --file - Non-human readable bls file.") fmt.Println(" --file - Non-human readable bls file.")
fmt.Println(" 13. importBls - Convert raw private key into encrypted bls key.") fmt.Println(" 13. importBLS - Convert raw private key into encrypted bls key.")
fmt.Println(" --key - Raw private key.") fmt.Println(" --key - Raw private key.")
fmt.Println(" 14. getBlsPublic - Show Bls public key given raw private bls key.") fmt.Println(" 14. getBLSPublic - Show BLS public key given raw private bls key.")
fmt.Println(" --key - Raw private key.") fmt.Println(" --key - Raw private key.")
fmt.Println(" --file - encrypted bls file.") fmt.Println(" --file - encrypted bls file.")
os.Exit(1) os.Exit(1)
@ -235,7 +235,7 @@ ARG:
case "exportPriKey": case "exportPriKey":
processExportPriKeyCommand() processExportPriKeyCommand()
case "blsgen": case "blsgen":
processBlsgenCommand() processBLSgenCommand()
case "removeAll": case "removeAll":
clearKeystore() clearKeystore()
case "import": case "import":
@ -253,10 +253,10 @@ ARG:
formatAddressCommand() formatAddressCommand()
case "blsRecovery": case "blsRecovery":
blsRecoveryCommand() blsRecoveryCommand()
case "importBls": case "importBLS":
importBls() importBLS()
case "getBlsPublic": case "getBLSPublic":
getBlsPublic() getBLSPublic()
default: default:
fmt.Printf("Unknown action: %s\n", os.Args[1]) fmt.Printf("Unknown action: %s\n", os.Args[1])
flag.PrintDefaults() flag.PrintDefaults()
@ -438,7 +438,7 @@ func processExportPriKeyCommand() {
} }
} }
func processBlsgenCommand() { func processBLSgenCommand() {
newCommand.Parse(os.Args[2:]) newCommand.Parse(os.Args[2:])
noPass := *newCommandNoPassPtr noPass := *newCommandNoPassPtr
pass := *newCommandPassPtr pass := *newCommandPassPtr
@ -461,14 +461,14 @@ func processBlsgenCommand() {
} }
} }
privateKey, fileName, err := blsgen.GenBlsKeyWithPassPhrase(password) privateKey, fileName, err := blsgen.GenBLSKeyWithPassPhrase(password)
if err != nil { if err != nil {
fmt.Printf("error when generating bls key: %v\n", err) fmt.Printf("error when generating bls key: %v\n", err)
os.Exit(100) os.Exit(100)
} }
publickKey := privateKey.GetPublicKey() publickKey := privateKey.GetPublicKey()
fmt.Printf("Bls private key: %s\n", privateKey.SerializeToHexStr()) fmt.Printf("BLS private key: %s\n", privateKey.SerializeToHexStr())
fmt.Printf("Bls public key: %s\n", publickKey.SerializeToHexStr()) fmt.Printf("BLS public key: %s\n", publickKey.SerializeToHexStr())
fmt.Printf("File storing the ENCRYPTED private key with your passphrase: %s\n", fileName) fmt.Printf("File storing the ENCRYPTED private key with your passphrase: %s\n", fileName)
} }
@ -586,7 +586,7 @@ func blsRecoveryCommand() {
if *blsPass == "" || *blsFile == "" { if *blsPass == "" || *blsFile == "" {
fmt.Println("Please specify the --file and --pass for bls passphrase.") fmt.Println("Please specify the --file and --pass for bls passphrase.")
} else { } else {
priKey, err := blsgen.LoadNonHumanReadableBlsKeyWithPassPhrase(*blsFile, *blsPass) priKey, err := blsgen.LoadNonHumanReadableBLSKeyWithPassPhrase(*blsFile, *blsPass)
if err != nil { if err != nil {
fmt.Printf("Not able to load non-human readable bls key. err:%v", err) fmt.Printf("Not able to load non-human readable bls key. err:%v", err)
os.Exit(100) os.Exit(100)
@ -599,7 +599,7 @@ func blsRecoveryCommand() {
} }
} }
func importBls() { func importBLS() {
if err := blsImportCommand.Parse(os.Args[2:]); err != nil { if err := blsImportCommand.Parse(os.Args[2:]); err != nil {
fmt.Println(ctxerror.New("failed to parse flags").WithCause(err)) fmt.Println(ctxerror.New("failed to parse flags").WithCause(err))
return return
@ -626,7 +626,7 @@ func importBls() {
} else { } else {
fmt.Printf("Your encrypted bls file with the passphrased is written at %s.\n", fileName) fmt.Printf("Your encrypted bls file with the passphrased is written at %s.\n", fileName)
} }
privateKey2, err := blsgen.LoadBlsKeyWithPassPhrase(fileName, passphrase) privateKey2, err := blsgen.LoadBLSKeyWithPassPhrase(fileName, passphrase)
if err != nil { if err != nil {
fmt.Printf("Error when loading the private key with the passphrase. Err: %v", err) fmt.Printf("Error when loading the private key with the passphrase. Err: %v", err)
os.Exit(101) os.Exit(101)
@ -641,8 +641,8 @@ func importBls() {
} }
} }
func getBlsPublic() { func getBLSPublic() {
if err := getBlsPublicCommand.Parse(os.Args[2:]); err != nil { if err := getBLSPublicCommand.Parse(os.Args[2:]); err != nil {
fmt.Println(ctxerror.New("failed to parse flags").WithCause(err)) fmt.Println(ctxerror.New("failed to parse flags").WithCause(err))
return return
} }
@ -662,7 +662,7 @@ func getBlsPublic() {
fmt.Printf("Passphrase doesn't match. Please try again!\n") fmt.Printf("Passphrase doesn't match. Please try again!\n")
os.Exit(100) os.Exit(100)
} }
privateKey, err := blsgen.LoadBlsKeyWithPassPhrase(*blsFile2, password) privateKey, err := blsgen.LoadBLSKeyWithPassPhrase(*blsFile2, password)
if err != nil { if err != nil {
fmt.Printf("error when loading bls key, err :%v\n", err) fmt.Printf("error when loading bls key, err :%v\n", err)
os.Exit(100) os.Exit(100)

@ -111,7 +111,7 @@ var (
blsFolder = flag.String("blsfolder", ".hmy/blskeys", "The folder that stores the bls keys and corresponding passphrases; e.g. <blskey>.key and <blskey>.pass; all bls keys mapped to same shard") blsFolder = flag.String("blsfolder", ".hmy/blskeys", "The folder that stores the bls keys and corresponding passphrases; e.g. <blskey>.key and <blskey>.pass; all bls keys mapped to same shard")
blsPass = flag.String("blspass", "", "The file containing passphrase to decrypt the encrypted bls file.") blsPass = flag.String("blspass", "", "The file containing passphrase to decrypt the encrypted bls file.")
blsPassphrase string blsPassphrase string
maxBlsKeysPerNode = flag.Int("max_bls_keys_per_node", 4, "maximum number of bls keys allowed per node (default 4)") maxBLSKeysPerNode = flag.Int("max_bls_keys_per_node", 4, "maximum number of bls keys allowed per node (default 4)")
// Sharding configuration parameters for devnet // Sharding configuration parameters for devnet
devnetNumShards = flag.Uint("dn_num_shards", 2, "number of shards for -network_type=devnet (default: 2)") devnetNumShards = flag.Uint("dn_num_shards", 2, "number of shards for -network_type=devnet (default: 2)")
devnetShardSize = flag.Int("dn_shard_size", 10, "number of nodes per shard for -network_type=devnet (default 10)") devnetShardSize = flag.Int("dn_shard_size", 10, "number of nodes per shard for -network_type=devnet (default 10)")
@ -154,7 +154,7 @@ func initSetup() {
} }
// maybe request passphrase for bls key. // maybe request passphrase for bls key.
passphraseForBls() passphraseForBLS()
// Configure log parameters // Configure log parameters
utils.SetLogContext(*port, *ip) utils.SetLogContext(*port, *ip)
@ -195,7 +195,7 @@ func initSetup() {
} }
} }
func passphraseForBls() { func passphraseForBLS() {
// If FN node running, they should either specify blsPrivateKey or the file with passphrase // If FN node running, they should either specify blsPrivateKey or the file with passphrase
// However, explorer or non-validator nodes need no blskey // However, explorer or non-validator nodes need no blskey
if *nodeType != "validator" { if *nodeType != "validator" {
@ -230,23 +230,23 @@ func findAccountsByPubKeys(config shardingconfig.Instance, pubKeys []*bls.Public
func setupLegacyNodeAccount() error { func setupLegacyNodeAccount() error {
genesisShardingConfig := shard.Schedule.InstanceForEpoch(big.NewInt(core.GenesisEpoch)) genesisShardingConfig := shard.Schedule.InstanceForEpoch(big.NewInt(core.GenesisEpoch))
multiBlsPubKey := setupConsensusKey(nodeconfig.GetDefaultConfig()) multiBLSPubKey := setupConsensusKey(nodeconfig.GetDefaultConfig())
reshardingEpoch := genesisShardingConfig.ReshardingEpoch() reshardingEpoch := genesisShardingConfig.ReshardingEpoch()
if reshardingEpoch != nil && len(reshardingEpoch) > 0 { if reshardingEpoch != nil && len(reshardingEpoch) > 0 {
for _, epoch := range reshardingEpoch { for _, epoch := range reshardingEpoch {
config := shard.Schedule.InstanceForEpoch(epoch) config := shard.Schedule.InstanceForEpoch(epoch)
findAccountsByPubKeys(config, multiBlsPubKey.PublicKey) findAccountsByPubKeys(config, multiBLSPubKey.PublicKey)
if len(initialAccounts) != 0 { if len(initialAccounts) != 0 {
break break
} }
} }
} else { } else {
findAccountsByPubKeys(genesisShardingConfig, multiBlsPubKey.PublicKey) findAccountsByPubKeys(genesisShardingConfig, multiBLSPubKey.PublicKey)
} }
if len(initialAccounts) == 0 { if len(initialAccounts) == 0 {
fmt.Fprintf(os.Stderr, "ERROR cannot find your BLS key in the genesis/FN tables: %s\n", multiBlsPubKey.SerializeToHexStr()) fmt.Fprintf(os.Stderr, "ERROR cannot find your BLS key in the genesis/FN tables: %s\n", multiBLSPubKey.SerializeToHexStr())
os.Exit(100) os.Exit(100)
} }
@ -268,14 +268,14 @@ func setupStakingNodeAccount() error {
for _, blsKey := range pubKey.PublicKey { for _, blsKey := range pubKey.PublicKey {
initialAccount := &genesis.DeployAccount{} initialAccount := &genesis.DeployAccount{}
initialAccount.ShardID = shardID initialAccount.ShardID = shardID
initialAccount.BlsPublicKey = blsKey.SerializeToHexStr() initialAccount.BLSPublicKey = blsKey.SerializeToHexStr()
initialAccount.Address = "" initialAccount.Address = ""
initialAccounts = append(initialAccounts, initialAccount) initialAccounts = append(initialAccounts, initialAccount)
} }
return nil return nil
} }
func readMultiBlsKeys(consensusMultiBlsPriKey *multibls.PrivateKey, consensusMultiBlsPubKey *multibls.PublicKey) error { func readMultiBLSKeys(consensusMultiBLSPriKey *multibls.PrivateKey, consensusMultiBLSPubKey *multibls.PublicKey) error {
keyPasses := map[string]string{} keyPasses := map[string]string{}
blsKeyFiles := []os.FileInfo{} blsKeyFiles := []os.FileInfo{}
if err := filepath.Walk(*blsFolder, func(path string, info os.FileInfo, err error) error { if err := filepath.Walk(*blsFolder, func(path string, info os.FileInfo, err error) error {
@ -309,10 +309,10 @@ func readMultiBlsKeys(consensusMultiBlsPriKey *multibls.PrivateKey, consensusMul
) )
os.Exit(100) os.Exit(100)
} }
if len(blsKeyFiles) > *maxBlsKeysPerNode { if len(blsKeyFiles) > *maxBLSKeysPerNode {
fmt.Fprintf(os.Stderr, fmt.Fprintf(os.Stderr,
"[Multi-BLS] maximum number of bls keys per node is %d, found: %d\n", "[Multi-BLS] maximum number of bls keys per node is %d, found: %d\n",
*maxBlsKeysPerNode, *maxBLSKeysPerNode,
len(blsKeyFiles), len(blsKeyFiles),
) )
os.Exit(100) os.Exit(100)
@ -325,13 +325,13 @@ func readMultiBlsKeys(consensusMultiBlsPriKey *multibls.PrivateKey, consensusMul
blsPassphrase = val blsPassphrase = val
} }
blsKeyFilePath := path.Join(*blsFolder, blsKeyFile.Name()) blsKeyFilePath := path.Join(*blsFolder, blsKeyFile.Name())
consensusPriKey, err := blsgen.LoadBlsKeyWithPassPhrase(blsKeyFilePath, blsPassphrase) consensusPriKey, err := blsgen.LoadBLSKeyWithPassPhrase(blsKeyFilePath, blsPassphrase)
if err != nil { if err != nil {
return err return err
} }
// TODO: assumes order between public/private key pairs // TODO: assumes order between public/private key pairs
multibls.AppendPriKey(consensusMultiBlsPriKey, consensusPriKey) multibls.AppendPriKey(consensusMultiBLSPriKey, consensusPriKey)
multibls.AppendPubKey(consensusMultiBlsPubKey, consensusPriKey.GetPublicKey()) multibls.AppendPubKey(consensusMultiBLSPubKey, consensusPriKey.GetPublicKey())
} }
return nil return nil
@ -342,7 +342,7 @@ func setupConsensusKey(nodeConfig *nodeconfig.ConfigType) multibls.PublicKey {
consensusMultiPubKey := &multibls.PublicKey{} consensusMultiPubKey := &multibls.PublicKey{}
if *blsKeyFile != "" { if *blsKeyFile != "" {
consensusPriKey, err := blsgen.LoadBlsKeyWithPassPhrase(*blsKeyFile, blsPassphrase) consensusPriKey, err := blsgen.LoadBLSKeyWithPassPhrase(*blsKeyFile, blsPassphrase)
if err != nil { if err != nil {
fmt.Fprintf(os.Stderr, "ERROR when loading bls key, err :%v\n", err) fmt.Fprintf(os.Stderr, "ERROR when loading bls key, err :%v\n", err)
os.Exit(100) os.Exit(100)
@ -350,7 +350,7 @@ func setupConsensusKey(nodeConfig *nodeconfig.ConfigType) multibls.PublicKey {
multibls.AppendPriKey(consensusMultiPriKey, consensusPriKey) multibls.AppendPriKey(consensusMultiPriKey, consensusPriKey)
multibls.AppendPubKey(consensusMultiPubKey, consensusPriKey.GetPublicKey()) multibls.AppendPubKey(consensusMultiPubKey, consensusPriKey.GetPublicKey())
} else { } else {
err := readMultiBlsKeys(consensusMultiPriKey, consensusMultiPubKey) err := readMultiBLSKeys(consensusMultiPriKey, consensusMultiPubKey)
if err != nil { if err != nil {
fmt.Fprintf(os.Stderr, "[Multi-BLS] ERROR when loading bls keys, err :%v\n", err) fmt.Fprintf(os.Stderr, "[Multi-BLS] ERROR when loading bls keys, err :%v\n", err)
os.Exit(100) os.Exit(100)
@ -437,7 +437,7 @@ func setupConsensusAndNode(nodeConfig *nodeconfig.ConfigType) *node.Node {
// staking validator doesn't have to specify ECDSA address // staking validator doesn't have to specify ECDSA address
currentConsensus.SelfAddresses = map[string]ethCommon.Address{} currentConsensus.SelfAddresses = map[string]ethCommon.Address{}
for _, initialAccount := range initialAccounts { for _, initialAccount := range initialAccounts {
currentConsensus.SelfAddresses[initialAccount.BlsPublicKey] = common.ParseAddr(initialAccount.Address) currentConsensus.SelfAddresses[initialAccount.BLSPublicKey] = common.ParseAddr(initialAccount.Address)
} }
if err != nil { if err != nil {
@ -800,7 +800,7 @@ func main() {
} }
utils.Logger().Info(). utils.Logger().Info().
Str("BlsPubKey", nodeConfig.ConsensusPubKey.SerializeToHexStr()). Str("BLSPubKey", nodeConfig.ConsensusPubKey.SerializeToHexStr()).
Uint32("ShardID", nodeConfig.ShardID). Uint32("ShardID", nodeConfig.ShardID).
Str("ShardGroupID", nodeConfig.GetShardGroupID().String()). Str("ShardGroupID", nodeConfig.GetShardGroupID().String()).
Str("BeaconGroupID", nodeConfig.GetBeaconGroupID().String()). Str("BeaconGroupID", nodeConfig.GetBeaconGroupID().String()).

@ -192,7 +192,7 @@ func (consensus *Consensus) GetConsensusLeaderPrivateKey() (*bls.SecretKey, erro
// New create a new Consensus record // New create a new Consensus record
func New( func New(
host p2p.Host, shard uint32, leader p2p.Peer, multiBlsPriKey *multibls.PrivateKey, host p2p.Host, shard uint32, leader p2p.Peer, multiBLSPriKey *multibls.PrivateKey,
Decider quorum.Decider, Decider quorum.Decider,
) (*Consensus, error) { ) (*Consensus, error) {
consensus := Consensus{} consensus := Consensus{}
@ -209,9 +209,9 @@ func New(
consensus.consensusTimeout = createTimeout() consensus.consensusTimeout = createTimeout()
consensus.validators.Store(leader.ConsensusPubKey.SerializeToHexStr(), leader) consensus.validators.Store(leader.ConsensusPubKey.SerializeToHexStr(), leader)
if multiBlsPriKey != nil { if multiBLSPriKey != nil {
consensus.priKey = multiBlsPriKey consensus.priKey = multiBLSPriKey
consensus.PubKey = multiBlsPriKey.GetPublicKey() consensus.PubKey = multiBLSPriKey.GetPublicKey()
utils.Logger().Info(). utils.Logger().Info().
Str("publicKey", consensus.PubKey.SerializeToHexStr()).Msg("My Public Key") Str("publicKey", consensus.PubKey.SerializeToHexStr()).Msg("My Public Key")
} else { } else {

@ -251,7 +251,7 @@ func verifyMessageSig(signerPubKey *bls.PublicKey, message *msg_pb.Message) erro
// verifySenderKey verifys the message senderKey is properly signed and senderAddr is valid // verifySenderKey verifys the message senderKey is properly signed and senderAddr is valid
func (consensus *Consensus) verifySenderKey(msg *msg_pb.Message) (*bls.PublicKey, error) { func (consensus *Consensus) verifySenderKey(msg *msg_pb.Message) (*bls.PublicKey, error) {
consensusMsg := msg.GetConsensus() consensusMsg := msg.GetConsensus()
senderKey, err := bls_cosi.BytesToBlsPublicKey(consensusMsg.SenderPubkey) senderKey, err := bls_cosi.BytesToBLSPublicKey(consensusMsg.SenderPubkey)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -264,7 +264,7 @@ func (consensus *Consensus) verifySenderKey(msg *msg_pb.Message) (*bls.PublicKey
func (consensus *Consensus) verifyViewChangeSenderKey(msg *msg_pb.Message) (*bls.PublicKey, error) { func (consensus *Consensus) verifyViewChangeSenderKey(msg *msg_pb.Message) (*bls.PublicKey, error) {
vcMsg := msg.GetViewchange() vcMsg := msg.GetViewchange()
senderKey, err := bls_cosi.BytesToBlsPublicKey(vcMsg.SenderPubkey) senderKey, err := bls_cosi.BytesToBLSPublicKey(vcMsg.SenderPubkey)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -428,21 +428,21 @@ func (consensus *Consensus) getLeaderPubKeyFromCoinbase(header *block.Header) (*
for _, member := range committee.Slots { for _, member := range committee.Slots {
if isStaking { if isStaking {
// After staking the coinbase address will be the address of bls public key // After staking the coinbase address will be the address of bls public key
if utils.GetAddressFromBlsPubKeyBytes(member.BlsPublicKey[:]) == header.Coinbase() { if utils.GetAddressFromBLSPubKeyBytes(member.BLSPublicKey[:]) == header.Coinbase() {
err := member.BlsPublicKey.ToLibBLSPublicKey(committerKey) err := member.BLSPublicKey.ToLibBLSPublicKey(committerKey)
if err != nil { if err != nil {
return nil, ctxerror.New("cannot convert BLS public key", return nil, ctxerror.New("cannot convert BLS public key",
"blsPublicKey", member.BlsPublicKey, "blsPublicKey", member.BLSPublicKey,
"coinbaseAddr", header.Coinbase()).WithCause(err) "coinbaseAddr", header.Coinbase()).WithCause(err)
} }
return committerKey, nil return committerKey, nil
} }
} else { } else {
if member.EcdsaAddress == header.Coinbase() { if member.EcdsaAddress == header.Coinbase() {
err := member.BlsPublicKey.ToLibBLSPublicKey(committerKey) err := member.BLSPublicKey.ToLibBLSPublicKey(committerKey)
if err != nil { if err != nil {
return nil, ctxerror.New("cannot convert BLS public key", return nil, ctxerror.New("cannot convert BLS public key",
"blsPublicKey", member.BlsPublicKey, "blsPublicKey", member.BLSPublicKey,
"coinbaseAddr", header.Coinbase()).WithCause(err) "coinbaseAddr", header.Coinbase()).WithCause(err)
} }
return committerKey, nil return committerKey, nil

@ -244,7 +244,7 @@ func ParseFBFTMessage(msg *msg_pb.Message) (*FBFTMessage, error) {
copy(pbftMsg.Payload[:], consensusMsg.Payload[:]) copy(pbftMsg.Payload[:], consensusMsg.Payload[:])
pbftMsg.Block = make([]byte, len(consensusMsg.Block)) pbftMsg.Block = make([]byte, len(consensusMsg.Block))
copy(pbftMsg.Block[:], consensusMsg.Block[:]) copy(pbftMsg.Block[:], consensusMsg.Block[:])
pubKey, err := bls_cosi.BytesToBlsPublicKey(consensusMsg.SenderPubkey) pubKey, err := bls_cosi.BytesToBLSPublicKey(consensusMsg.SenderPubkey)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -266,12 +266,12 @@ func ParseViewChangeMessage(msg *msg_pb.Message) (*FBFTMessage, error) {
pbftMsg.Payload = make([]byte, len(vcMsg.Payload)) pbftMsg.Payload = make([]byte, len(vcMsg.Payload))
copy(pbftMsg.Payload[:], vcMsg.Payload[:]) copy(pbftMsg.Payload[:], vcMsg.Payload[:])
pubKey, err := bls_cosi.BytesToBlsPublicKey(vcMsg.SenderPubkey) pubKey, err := bls_cosi.BytesToBLSPublicKey(vcMsg.SenderPubkey)
if err != nil { if err != nil {
utils.Logger().Warn().Err(err).Msg("ParseViewChangeMessage failed to parse senderpubkey") utils.Logger().Warn().Err(err).Msg("ParseViewChangeMessage failed to parse senderpubkey")
return nil, err return nil, err
} }
leaderKey, err := bls_cosi.BytesToBlsPublicKey(vcMsg.LeaderPubkey) leaderKey, err := bls_cosi.BytesToBLSPublicKey(vcMsg.LeaderPubkey)
if err != nil { if err != nil {
utils.Logger().Warn().Err(err).Msg("ParseViewChangeMessage failed to parse leaderpubkey") utils.Logger().Warn().Err(err).Msg("ParseViewChangeMessage failed to parse leaderpubkey")
return nil, err return nil, err
@ -312,7 +312,7 @@ func (consensus *Consensus) ParseNewViewMessage(msg *msg_pb.Message) (*FBFTMessa
FBFTMsg.Payload = make([]byte, len(vcMsg.Payload)) FBFTMsg.Payload = make([]byte, len(vcMsg.Payload))
copy(FBFTMsg.Payload[:], vcMsg.Payload[:]) copy(FBFTMsg.Payload[:], vcMsg.Payload[:])
pubKey, err := bls_cosi.BytesToBlsPublicKey(vcMsg.SenderPubkey) pubKey, err := bls_cosi.BytesToBLSPublicKey(vcMsg.SenderPubkey)
if err != nil { if err != nil {
utils.Logger().Warn().Err(err).Msg("ParseViewChangeMessage failed to parse senderpubkey") utils.Logger().Warn().Err(err).Msg("ParseViewChangeMessage failed to parse senderpubkey")
return nil, err return nil, err

@ -27,7 +27,7 @@ type TallyResult struct {
} }
type voteBox struct { type voteBox struct {
voters map[shard.BlsPublicKey]struct{} voters map[shard.BLSPublicKey]struct{}
currentTotal numeric.Dec currentTotal numeric.Dec
} }
@ -81,7 +81,7 @@ func (v *stakedVoteWeight) IsQuorumAchievedByMask(mask *bls_cosi.Mask) bool {
return (*currentTotalPower).GT(threshold) return (*currentTotalPower).GT(threshold)
} }
func (v *stakedVoteWeight) computeCurrentTotalPower(p Phase) (*numeric.Dec, error) { func (v *stakedVoteWeight) computeCurrentTotalPower(p Phase) (*numeric.Dec, error) {
w := shard.BlsPublicKey{} w := shard.BLSPublicKey{}
members := v.Participants() members := v.Participants()
ballot := func() *voteBox { ballot := func() *voteBox {
switch p { switch p {
@ -116,7 +116,7 @@ func (v *stakedVoteWeight) computeCurrentTotalPower(p Phase) (*numeric.Dec, erro
// ComputeTotalPowerByMask computes the total power indicated by bitmap mask // ComputeTotalPowerByMask computes the total power indicated by bitmap mask
func (v *stakedVoteWeight) computeTotalPowerByMask(mask *bls_cosi.Mask) *numeric.Dec { func (v *stakedVoteWeight) computeTotalPowerByMask(mask *bls_cosi.Mask) *numeric.Dec {
pubKeys := mask.Publics pubKeys := mask.Publics
w := shard.BlsPublicKey{} w := shard.BLSPublicKey{}
currentTotal := numeric.ZeroDec() currentTotal := numeric.ZeroDec()
for i := range pubKeys { for i := range pubKeys {
@ -240,7 +240,7 @@ func (v *stakedVoteWeight) AmIMemberOfCommitee() bool {
} }
identity, _ := pubKeyFunc() identity, _ := pubKeyFunc()
for _, key := range identity.PublicKey { for _, key := range identity.PublicKey {
if w := (shard.BlsPublicKey{}); w.FromLibBLSPublicKey(key) != nil { if w := (shard.BLSPublicKey{}); w.FromLibBLSPublicKey(key) != nil {
_, ok := v.roster.Voters[w] _, ok := v.roster.Voters[w]
if ok { if ok {
return true return true
@ -251,7 +251,7 @@ func (v *stakedVoteWeight) AmIMemberOfCommitee() bool {
} }
func newBox() *voteBox { func newBox() *voteBox {
return &voteBox{map[shard.BlsPublicKey]struct{}{}, numeric.ZeroDec()} return &voteBox{map[shard.BLSPublicKey]struct{}{}, numeric.ZeroDec()}
} }
func newBallotBox() box { func newBallotBox() box {

@ -28,7 +28,7 @@ var (
stakeGen = rand.New(rand.NewSource(541)) stakeGen = rand.New(rand.NewSource(541))
) )
type secretKeyMap map[shard.BlsPublicKey]bls.SecretKey type secretKeyMap map[shard.BLSPublicKey]bls.SecretKey
func init() { func init() {
basicDecider = NewDecider(SuperMajorityStake, shard.BeaconChainShardID) basicDecider = NewDecider(SuperMajorityStake, shard.BeaconChainShardID)
@ -40,7 +40,7 @@ func generateRandomSlot() (shard.Slot, bls.SecretKey) {
addr.SetBytes(big.NewInt(int64(accountGen.Int63n(maxAccountGen))).Bytes()) addr.SetBytes(big.NewInt(int64(accountGen.Int63n(maxAccountGen))).Bytes())
secretKey := bls.SecretKey{} secretKey := bls.SecretKey{}
secretKey.Deserialize(big.NewInt(int64(keyGen.Int63n(maxKeyGen))).Bytes()) secretKey.Deserialize(big.NewInt(int64(keyGen.Int63n(maxKeyGen))).Bytes())
key := shard.BlsPublicKey{} key := shard.BLSPublicKey{}
key.FromLibBLSPublicKey(secretKey.GetPublicKey()) key.FromLibBLSPublicKey(secretKey.GetPublicKey())
stake := numeric.NewDecFromBigInt(big.NewInt(int64(stakeGen.Int63n(maxStakeGen)))) stake := numeric.NewDecFromBigInt(big.NewInt(int64(stakeGen.Int63n(maxStakeGen))))
return shard.Slot{addr, key, &stake}, secretKey return shard.Slot{addr, key, &stake}, secretKey
@ -58,9 +58,9 @@ func setupBaseCase() (Decider, *TallyResult, shard.SlotList, map[string]secretKe
newSlot, sKey := generateRandomSlot() newSlot, sKey := generateRandomSlot()
if i < 50 { if i < 50 {
newSlot.EffectiveStake = nil newSlot.EffectiveStake = nil
sKeys[hmy][newSlot.BlsPublicKey] = sKey sKeys[hmy][newSlot.BLSPublicKey] = sKey
} else { } else {
sKeys[reg][newSlot.BlsPublicKey] = sKey sKeys[reg][newSlot.BLSPublicKey] = sKey
} }
slotList = append(slotList, newSlot) slotList = append(slotList, newSlot)
pubKeys = append(pubKeys, sKey.GetPublicKey()) pubKeys = append(pubKeys, sKey.GetPublicKey())
@ -87,7 +87,7 @@ func setupEdgeCase() (Decider, *TallyResult, shard.SlotList, secretKeyMap) {
newSlot, sKey := generateRandomSlot() newSlot, sKey := generateRandomSlot()
if i < 33 { if i < 33 {
newSlot.EffectiveStake = nil newSlot.EffectiveStake = nil
sKeys[newSlot.BlsPublicKey] = sKey sKeys[newSlot.BLSPublicKey] = sKey
} }
slotList = append(slotList, newSlot) slotList = append(slotList, newSlot)
pubKeys = append(pubKeys, sKey.GetPublicKey()) pubKeys = append(pubKeys, sKey.GetPublicKey())

@ -198,7 +198,7 @@ func (s *cIdentities) Participants() []*bls.PublicKey {
func (s *cIdentities) UpdateParticipants(pubKeys []*bls.PublicKey) { func (s *cIdentities) UpdateParticipants(pubKeys []*bls.PublicKey) {
for i := range pubKeys { for i := range pubKeys {
k := shard.BlsPublicKey{} k := shard.BLSPublicKey{}
k.FromLibBLSPublicKey(pubKeys[i]) k.FromLibBLSPublicKey(pubKeys[i])
} }
s.publicKeys = append(pubKeys[:0:0], pubKeys...) s.publicKeys = append(pubKeys[:0:0], pubKeys...)
@ -268,7 +268,7 @@ func (s *cIdentities) TwoThirdsSignersCount() int64 {
} }
func (s *cIdentities) ReadBallot(p Phase, PubKey *bls.PublicKey) *votepower.Ballot { func (s *cIdentities) ReadBallot(p Phase, PubKey *bls.PublicKey) *votepower.Ballot {
ballotBox := map[shard.BlsPublicKey]*votepower.Ballot{} ballotBox := map[shard.BLSPublicKey]*votepower.Ballot{}
key := *shard.FromLibBLSPublicKeyUnsafe(PubKey) key := *shard.FromLibBLSPublicKeyUnsafe(PubKey)
switch p { switch p {
@ -288,7 +288,7 @@ func (s *cIdentities) ReadBallot(p Phase, PubKey *bls.PublicKey) *votepower.Ball
} }
func (s *cIdentities) ReadAllBallots(p Phase) []*votepower.Ballot { func (s *cIdentities) ReadAllBallots(p Phase) []*votepower.Ballot {
m := map[shard.BlsPublicKey]*votepower.Ballot{} m := map[shard.BLSPublicKey]*votepower.Ballot{}
switch p { switch p {
case Prepare: case Prepare:
m = s.prepare.BallotBox m = s.prepare.BallotBox

@ -23,7 +23,7 @@ var (
// Ballot is a vote cast by a validator // Ballot is a vote cast by a validator
type Ballot struct { type Ballot struct {
SignerPubKey shard.BlsPublicKey `json:"bls-public-key"` SignerPubKey shard.BLSPublicKey `json:"bls-public-key"`
BlockHeaderHash common.Hash `json:"block-header-hash"` BlockHeaderHash common.Hash `json:"block-header-hash"`
Signature []byte `json:"bls-signature"` Signature []byte `json:"bls-signature"`
Height uint64 `json:"block-height"` Height uint64 `json:"block-height"`
@ -50,7 +50,7 @@ func (b Ballot) MarshalJSON() ([]byte, error) {
// Round is a round of voting in any FBFT phase // Round is a round of voting in any FBFT phase
type Round struct { type Round struct {
AggregatedVote *bls.Sign AggregatedVote *bls.Sign
BallotBox map[shard.BlsPublicKey]*Ballot BallotBox map[shard.BLSPublicKey]*Ballot
} }
func (b Ballot) String() string { func (b Ballot) String() string {
@ -62,14 +62,14 @@ func (b Ballot) String() string {
func NewRound() *Round { func NewRound() *Round {
return &Round{ return &Round{
AggregatedVote: &bls.Sign{}, AggregatedVote: &bls.Sign{},
BallotBox: map[shard.BlsPublicKey]*Ballot{}, BallotBox: map[shard.BLSPublicKey]*Ballot{},
} }
} }
// PureStakedVote .. // PureStakedVote ..
type PureStakedVote struct { type PureStakedVote struct {
EarningAccount common.Address `json:"earning-account"` EarningAccount common.Address `json:"earning-account"`
Identity shard.BlsPublicKey `json:"bls-public-key"` Identity shard.BLSPublicKey `json:"bls-public-key"`
GroupPercent numeric.Dec `json:"group-percent"` GroupPercent numeric.Dec `json:"group-percent"`
EffectiveStake numeric.Dec `json:"effective-stake"` EffectiveStake numeric.Dec `json:"effective-stake"`
} }
@ -96,7 +96,7 @@ type topLevelRegistry struct {
// Roster .. // Roster ..
type Roster struct { type Roster struct {
Voters map[shard.BlsPublicKey]*AccommodateHarmonyVote Voters map[shard.BLSPublicKey]*AccommodateHarmonyVote
topLevelRegistry topLevelRegistry
ShardID uint32 ShardID uint32
} }
@ -184,7 +184,7 @@ func Compute(subComm *shard.Committee, epoch *big.Int) (*Roster, error) {
member := AccommodateHarmonyVote{ member := AccommodateHarmonyVote{
PureStakedVote: PureStakedVote{ PureStakedVote: PureStakedVote{
EarningAccount: staked[i].EcdsaAddress, EarningAccount: staked[i].EcdsaAddress,
Identity: staked[i].BlsPublicKey, Identity: staked[i].BLSPublicKey,
GroupPercent: numeric.ZeroDec(), GroupPercent: numeric.ZeroDec(),
EffectiveStake: numeric.ZeroDec(), EffectiveStake: numeric.ZeroDec(),
}, },
@ -207,10 +207,10 @@ func Compute(subComm *shard.Committee, epoch *big.Int) (*Roster, error) {
} }
// TODO: make sure external user's BLS key can be same as harmony's bls keys // TODO: make sure external user's BLS key can be same as harmony's bls keys
if _, ok := roster.Voters[staked[i].BlsPublicKey]; !ok { if _, ok := roster.Voters[staked[i].BLSPublicKey]; !ok {
roster.Voters[staked[i].BlsPublicKey] = &member roster.Voters[staked[i].BLSPublicKey] = &member
} else { } else {
utils.Logger().Debug().Str("blsKey", staked[i].BlsPublicKey.Hex()).Msg("Duplicate BLS key found") utils.Logger().Debug().Str("blsKey", staked[i].BLSPublicKey.Hex()).Msg("Duplicate BLS key found")
} }
} }
@ -236,7 +236,7 @@ func Compute(subComm *shard.Committee, epoch *big.Int) (*Roster, error) {
// NewRoster .. // NewRoster ..
func NewRoster(shardID uint32) *Roster { func NewRoster(shardID uint32) *Roster {
m := map[shard.BlsPublicKey]*AccommodateHarmonyVote{} m := map[shard.BLSPublicKey]*AccommodateHarmonyVote{}
return &Roster{ return &Roster{
Voters: m, Voters: m,
topLevelRegistry: topLevelRegistry{ topLevelRegistry: topLevelRegistry{

@ -47,7 +47,7 @@ func generateRandomSlot() shard.Slot {
addr.SetBytes(big.NewInt(int64(accountGen.Int63n(maxAccountGen))).Bytes()) addr.SetBytes(big.NewInt(int64(accountGen.Int63n(maxAccountGen))).Bytes())
secretKey := bls.SecretKey{} secretKey := bls.SecretKey{}
secretKey.Deserialize(big.NewInt(int64(keyGen.Int63n(maxKeyGen))).Bytes()) secretKey.Deserialize(big.NewInt(int64(keyGen.Int63n(maxKeyGen))).Bytes())
key := shard.BlsPublicKey{} key := shard.BLSPublicKey{}
key.FromLibBLSPublicKey(secretKey.GetPublicKey()) key.FromLibBLSPublicKey(secretKey.GetPublicKey())
stake := numeric.NewDecFromBigInt(big.NewInt(int64(stakeGen.Int63n(maxStakeGen)))) stake := numeric.NewDecFromBigInt(big.NewInt(int64(stakeGen.Int63n(maxStakeGen))))
return shard.Slot{addr, key, &stake} return shard.Slot{addr, key, &stake}
@ -68,7 +68,7 @@ func TestCompute(t *testing.T) {
member := AccommodateHarmonyVote{ member := AccommodateHarmonyVote{
PureStakedVote: PureStakedVote{ PureStakedVote: PureStakedVote{
EarningAccount: staked[i].EcdsaAddress, EarningAccount: staked[i].EcdsaAddress,
Identity: staked[i].BlsPublicKey, Identity: staked[i].BLSPublicKey,
GroupPercent: numeric.ZeroDec(), GroupPercent: numeric.ZeroDec(),
EffectiveStake: numeric.ZeroDec(), EffectiveStake: numeric.ZeroDec(),
}, },
@ -91,7 +91,7 @@ func TestCompute(t *testing.T) {
ourPercentage = ourPercentage.Add(member.OverallPercent) ourPercentage = ourPercentage.Add(member.OverallPercent)
} }
expectedRoster.Voters[staked[i].BlsPublicKey] = &member expectedRoster.Voters[staked[i].BLSPublicKey] = &member
} }
expectedRoster.OurVotingPowerTotalPercentage = ourPercentage expectedRoster.OurVotingPowerTotalPercentage = ourPercentage

@ -1,13 +1,5 @@
The smart contract files in this folder contains protocol-level smart contracts that are critical to the overall operation of Harmony protocol: The smart contract files in this folder contains protocol-level smart contracts that are critical to the overall operation of Harmony protocol:
* Faucet.sol is the smart contract to dispense free test tokens in our testnet. - Faucet.sol is the smart contract to dispense free test tokens in our testnet.
* StakeLockContract.sol is the staking smart contract that receives and locks stakes. The stakes are used for the POS and sharding protocol.
Solc is needed to recompile the contracts into ABI and bytecode. Please follow https://solidity.readthedocs.io/en/v0.5.3/installing-solidity.html for the installation. Solc is needed to recompile the contracts into ABI and bytecode. Please follow https://solidity.readthedocs.io/en/v0.5.3/installing-solidity.html for the installation.
Example command to compile a contract file into golang ABI.
```bash
abigen -sol contracts/StakeLockContract.sol -pkg contracts -out contracts/StakeLockContract.go
```

File diff suppressed because one or more lines are too long

@ -1,148 +0,0 @@
pragma solidity >=0.4.22;
contract StakeLockContract {
/**
* @dev Error messages for require statements
*/
string internal constant ALREADY_LOCKED = 'Tokens already locked';
string internal constant NO_TOKEN_UNLOCKABLE = 'No tokens unlockable';
string internal constant AMOUNT_ZERO = 'Amount can not be 0';
string internal constant EMPTY_BLS_PUBKEY = 'BLS public key should not be empty';
uint256 internal constant LOCK_PERIOD_IN_EPOCHS = 3; // Final locking period TBD.
uint256 internal numBlocksPerEpoch = 5; // This value is for testing only
/**
* @dev locked token structure
*/
struct lockedToken {
uint256 _amount; // The amount of token locked
uint256 _blockNum; // The number of the block when the token was locked
uint256 _epochNum; // The epoch when the token was locked
uint256 _lockPeriodCount; // The number of locking period the token will be locked.
uint256 _index; // The index in the addressList
bytes32 _blsPublicKey1; // The BLS public key divided into 3 32bytes chucks used for consensus message signing.
bytes32 _blsPublicKey2;
bytes32 _blsPublicKey3;
// TODO: the BLS public key should be signed by the bls key to prove the ownership.
}
/**
* @dev Holds number & validity of tokens locked for a given reason for
* a specified address
*/
mapping(address => lockedToken) private locked;
mapping(address => uint) private indices;
address[] private addressList;
event Locked(address indexed _of, uint _amount, uint256 _epoch);
event Unlocked(address indexed account, uint index);
/**
* @dev Locks a specified amount of tokens against an address
* starting at the specific epoch
* @param _blsPublicKey1 The first part of BLS public key for consensus message signing
* @param _blsPublicKey2 The second part of BLS public key for consensus message signing
* @param _blsPublicKey3 The third part of BLS public key for consensus message signing
*/
function lock(bytes32 _blsPublicKey1, bytes32 _blsPublicKey2, bytes32 _blsPublicKey3)
public
payable
returns (bool)
{
// If tokens are already locked, then functions extendLock or
// increaseLockAmount should be used to make any changes
// require(_blsPublicKey != 0, EMPTY_BLS_PUBKEY);
require(balanceOf(msg.sender) == 0, ALREADY_LOCKED);
require(msg.value != 0, AMOUNT_ZERO);
// By default, the tokens can only be locked for one locking period.
locked[msg.sender] = lockedToken(msg.value, block.number, currentEpoch(), 1, addressList.push(msg.sender) - 1, _blsPublicKey1, _blsPublicKey2, _blsPublicKey3);
emit Locked(msg.sender, msg.value, currentEpoch());
return true;
}
/**
* @dev Unlocks the unlockable tokens of a specified address
*/
function unlock()
public
returns (uint256 unlockableTokens)
{
unlockableTokens = getUnlockableTokens(msg.sender); // For now the unlockableTokens is all the tokens for a address
require(unlockableTokens != 0, NO_TOKEN_UNLOCKABLE);
uint indexToRemove = locked[msg.sender]._index;
delete locked[msg.sender];
addressList[indexToRemove] = addressList[addressList.length - 1];
locked[addressList[addressList.length - 1]]._index = indexToRemove;
addressList.length--;
msg.sender.transfer(unlockableTokens);
}
/**
* @dev Gets the unlockable tokens of a specified address
* @param _of The address to query the unlockable token
*/
function getUnlockableTokens(address _of)
public
view
returns (uint256 unlockableTokens)
{
uint256 currentEpoch = currentEpoch();
if (locked[_of]._epochNum + locked[_of]._lockPeriodCount * LOCK_PERIOD_IN_EPOCHS < currentEpoch) {
unlockableTokens = locked[_of]._amount;
}
}
/**
* @dev Gets the token balance of a specified address
* @param _of The address to query the token balance
*/
function balanceOf(address _of)
public
view
returns (uint256 balance)
{
balance = locked[_of]._amount;
}
/**
* @dev Gets the epoch number of the specified block number.
*/
function currentEpoch()
public
view
returns (uint256)
{
return block.number / numBlocksPerEpoch;
}
/**
* @dev Lists all the locked address data.
*/
function listLockedAddresses()
public
view
returns (address[] memory lockedAddresses, bytes32[] memory blsPubicKeys1, bytes32[] memory blsPubicKeys2, bytes32[] memory blsPubicKeys3, uint256[] memory blockNums, uint256[] memory lockPeriodCounts, uint256[] memory amounts)
{
lockedAddresses = addressList;
blsPubicKeys1 = new bytes32[](addressList.length);
blsPubicKeys2 = new bytes32[](addressList.length);
blsPubicKeys3 = new bytes32[](addressList.length);
blockNums = new uint256[](addressList.length);
lockPeriodCounts = new uint256[](addressList.length);
amounts = new uint256[](addressList.length);
for (uint i = 0; i < lockedAddresses.length; i++) {
blockNums[i] = locked[lockedAddresses[i]]._blockNum;
blsPubicKeys1[i] = locked[lockedAddresses[i]]._blsPublicKey1;
blsPubicKeys2[i] = locked[lockedAddresses[i]]._blsPublicKey2;
blsPubicKeys3[i] = locked[lockedAddresses[i]]._blsPublicKey3;
lockPeriodCounts[i] = locked[lockedAddresses[i]]._lockPeriodCount;
amounts[i] = locked[lockedAddresses[i]]._amount;
}
}
}

@ -1,4 +1,3 @@
# abigen -sol Lottery.sol -out Lottery.go --pkg contracts # abigen -sol Lottery.sol -out Lottery.go --pkg contracts
abigen -sol Puzzle.sol -out Puzzle.go --pkg contracts abigen -sol Puzzle.sol -out Puzzle.go --pkg contracts
# abigen -sol Faucet.sol -out Faucet.go --pkg contracts # abigen -sol Faucet.sol -out Faucet.go --pkg contracts
abigen -sol StakeLockContract.sol -out StakeLockContract.go --pkg contracts

@ -2725,7 +2725,7 @@ func (bc *BlockChain) GetECDSAFromCoinbase(header *block.Header) (common.Address
return member.EcdsaAddress, nil return member.EcdsaAddress, nil
} }
if utils.GetAddressFromBlsPubKeyBytes(member.BlsPublicKey[:]) == coinbase { if utils.GetAddressFromBLSPubKeyBytes(member.BLSPublicKey[:]) == coinbase {
return member.EcdsaAddress, nil return member.EcdsaAddress, nil
} }
} }

@ -88,9 +88,9 @@ func TestMixedLookupStorage(t *testing.T) {
stakePayloadMaker := func() (staking.Directive, interface{}) { stakePayloadMaker := func() (staking.Directive, interface{}) {
p := &bls.PublicKey{} p := &bls.PublicKey{}
p.DeserializeHexStr(testBLSPubKey) p.DeserializeHexStr(testBLSPubKey)
pub := shard.BlsPublicKey{} pub := shard.BLSPublicKey{}
pub.FromLibBLSPublicKey(p) pub.FromLibBLSPublicKey(p)
messageBytes := []byte(staking.BlsVerificationStr) messageBytes := []byte(staking.BLSVerificationStr)
privateKey := &bls.SecretKey{} privateKey := &bls.SecretKey{}
privateKey.DeserializeHexStr(testBLSPrvKey) privateKey.DeserializeHexStr(testBLSPrvKey)
msgHash := hash.Keccak256(messageBytes) msgHash := hash.Keccak256(messageBytes)
@ -117,7 +117,7 @@ func TestMixedLookupStorage(t *testing.T) {
MinSelfDelegation: big.NewInt(1e18), MinSelfDelegation: big.NewInt(1e18),
MaxTotalDelegation: big.NewInt(3e18), MaxTotalDelegation: big.NewInt(3e18),
ValidatorAddress: crypto.PubkeyToAddress(key.PublicKey), ValidatorAddress: crypto.PubkeyToAddress(key.PublicKey),
SlotPubKeys: []shard.BlsPublicKey{pub}, SlotPubKeys: []shard.BLSPublicKey{pub},
SlotKeySigs: []shard.BLSSignature{sig}, SlotKeySigs: []shard.BLSSignature{sig},
Amount: big.NewInt(1e18), Amount: big.NewInt(1e18),
} }

@ -24,12 +24,12 @@ var (
twelveK = new(big.Int).Mul(big.NewInt(12000), big.NewInt(1e18)) twelveK = new(big.Int).Mul(big.NewInt(12000), big.NewInt(1e18))
) )
func generateBlsKeySigPair() (shard.BlsPublicKey, shard.BLSSignature) { func generateBLSKeySigPair() (shard.BLSPublicKey, shard.BLSSignature) {
p := &bls.PublicKey{} p := &bls.PublicKey{}
p.DeserializeHexStr(testBLSPubKey) p.DeserializeHexStr(testBLSPubKey)
pub := shard.BlsPublicKey{} pub := shard.BLSPublicKey{}
pub.FromLibBLSPublicKey(p) pub.FromLibBLSPublicKey(p)
messageBytes := []byte(staking.BlsVerificationStr) messageBytes := []byte(staking.BLSVerificationStr)
privateKey := &bls.SecretKey{} privateKey := &bls.SecretKey{}
privateKey.DeserializeHexStr(testBLSPrvKey) privateKey.DeserializeHexStr(testBLSPrvKey)
msgHash := hash.Keccak256(messageBytes) msgHash := hash.Keccak256(messageBytes)
@ -57,8 +57,8 @@ func createValidator() *staking.CreateValidator {
} }
minSelfDel := tenK minSelfDel := tenK
maxTotalDel := twelveK maxTotalDel := twelveK
pubKey, pubSig := generateBlsKeySigPair() pubKey, pubSig := generateBLSKeySigPair()
slotPubKeys := []shard.BlsPublicKey{pubKey} slotPubKeys := []shard.BLSPublicKey{pubKey}
slotKeySigs := []shard.BLSSignature{pubSig} slotKeySigs := []shard.BLSSignature{pubSig}
amount := tenK amount := tenK
v := staking.CreateValidator{ v := staking.CreateValidator{

@ -87,9 +87,9 @@ func stakingCreateValidatorTransaction(key *ecdsa.PrivateKey) (*staking.StakingT
stakePayloadMaker := func() (staking.Directive, interface{}) { stakePayloadMaker := func() (staking.Directive, interface{}) {
p := &bls.PublicKey{} p := &bls.PublicKey{}
p.DeserializeHexStr(testBLSPubKey) p.DeserializeHexStr(testBLSPubKey)
pub := shard.BlsPublicKey{} pub := shard.BLSPublicKey{}
pub.FromLibBLSPublicKey(p) pub.FromLibBLSPublicKey(p)
messageBytes := []byte(staking.BlsVerificationStr) messageBytes := []byte(staking.BLSVerificationStr)
privateKey := &bls.SecretKey{} privateKey := &bls.SecretKey{}
privateKey.DeserializeHexStr(testBLSPrvKey) privateKey.DeserializeHexStr(testBLSPrvKey)
msgHash := hash.Keccak256(messageBytes) msgHash := hash.Keccak256(messageBytes)
@ -116,7 +116,7 @@ func stakingCreateValidatorTransaction(key *ecdsa.PrivateKey) (*staking.StakingT
MinSelfDelegation: tenK, MinSelfDelegation: tenK,
MaxTotalDelegation: twelveK, MaxTotalDelegation: twelveK,
ValidatorAddress: crypto.PubkeyToAddress(key.PublicKey), ValidatorAddress: crypto.PubkeyToAddress(key.PublicKey),
SlotPubKeys: []shard.BlsPublicKey{pub}, SlotPubKeys: []shard.BLSPublicKey{pub},
SlotKeySigs: []shard.BLSSignature{sig}, SlotKeySigs: []shard.BLSSignature{sig},
Amount: tenK, Amount: tenK,
} }

@ -19,10 +19,10 @@ func RandPrivateKey() *bls.SecretKey {
return &sec return &sec
} }
// BytesToBlsPublicKey converts bytes into bls.PublicKey pointer. // BytesToBLSPublicKey converts bytes into bls.PublicKey pointer.
func BytesToBlsPublicKey(bytes []byte) (*bls.PublicKey, error) { func BytesToBLSPublicKey(bytes []byte) (*bls.PublicKey, error) {
if len(bytes) == 0 { if len(bytes) == 0 {
return nil, fmt.Errorf("[BytesToBlsPublicKey] bytes is empty") return nil, fmt.Errorf("[BytesToBLSPublicKey] bytes is empty")
} }
pubKey := &bls.PublicKey{} pubKey := &bls.PublicKey{}
err := pubKey.Deserialize(bytes) err := pubKey.Deserialize(bytes)

@ -178,8 +178,8 @@ func verifyMessageSig(signerPubKey *bls.PublicKey, message *msg_pb.Message) erro
} }
// IsValidatorInCommittee returns whether the given validator BLS address is part of my committee // IsValidatorInCommittee returns whether the given validator BLS address is part of my committee
func (dRand *DRand) IsValidatorInCommittee(validatorBlsPubKey string) bool { func (dRand *DRand) IsValidatorInCommittee(validatorBLSPubKey string) bool {
_, ok := dRand.CommitteePublicKeys[validatorBlsPubKey] _, ok := dRand.CommitteePublicKeys[validatorBLSPubKey]
return ok return ok
} }

@ -129,7 +129,7 @@ func (dRand *DRand) processCommitMessage(message *msg_pb.Message) {
drandMsg := message.GetDrand() drandMsg := message.GetDrand()
senderPubKey, err := bls.BytesToBlsPublicKey(drandMsg.SenderPubkey) senderPubKey, err := bls.BytesToBLSPublicKey(drandMsg.SenderPubkey)
if err != nil { if err != nil {
utils.Logger().Debug().Err(err).Msg("Failed to deserialize BLS public key") utils.Logger().Debug().Err(err).Msg("Failed to deserialize BLS public key")
return return

@ -29,8 +29,8 @@ func toISO8601(t time.Time) string {
t.Year(), t.Month(), t.Day(), t.Hour(), t.Minute(), t.Second(), t.Nanosecond(), tz) t.Year(), t.Month(), t.Day(), t.Hour(), t.Minute(), t.Second(), t.Nanosecond(), tz)
} }
// GenBlsKeyWithPassPhrase generates bls key with passphrase and write into disk. // GenBLSKeyWithPassPhrase generates bls key with passphrase and write into disk.
func GenBlsKeyWithPassPhrase(passphrase string) (*ffi_bls.SecretKey, string, error) { func GenBLSKeyWithPassPhrase(passphrase string) (*ffi_bls.SecretKey, string, error) {
privateKey := bls.RandPrivateKey() privateKey := bls.RandPrivateKey()
publickKey := privateKey.GetPublicKey() publickKey := privateKey.GetPublicKey()
fileName := publickKey.SerializeToHexStr() + ".key" fileName := publickKey.SerializeToHexStr() + ".key"
@ -75,8 +75,8 @@ func WriteToFile(filename string, data string) error {
return file.Sync() return file.Sync()
} }
// LoadBlsKeyWithPassPhrase loads bls key with passphrase. // LoadBLSKeyWithPassPhrase loads bls key with passphrase.
func LoadBlsKeyWithPassPhrase(fileName, passphrase string) (*ffi_bls.SecretKey, error) { func LoadBLSKeyWithPassPhrase(fileName, passphrase string) (*ffi_bls.SecretKey, error) {
encryptedPrivateKeyBytes, err := ioutil.ReadFile(fileName) encryptedPrivateKeyBytes, err := ioutil.ReadFile(fileName)
if err != nil { if err != nil {
return nil, err return nil, err
@ -169,8 +169,8 @@ func decryptNonHumanReadable(data []byte, passphrase string) ([]byte, error) {
return plaintext, nil return plaintext, nil
} }
// LoadNonHumanReadableBlsKeyWithPassPhrase loads bls key with passphrase. // LoadNonHumanReadableBLSKeyWithPassPhrase loads bls key with passphrase.
func LoadNonHumanReadableBlsKeyWithPassPhrase(fileName, passFile string) (*ffi_bls.SecretKey, error) { func LoadNonHumanReadableBLSKeyWithPassPhrase(fileName, passFile string) (*ffi_bls.SecretKey, error) {
encryptedPrivateKeyBytes, err := ioutil.ReadFile(fileName) encryptedPrivateKeyBytes, err := ioutil.ReadFile(fileName)
if err != nil { if err != nil {
return nil, err return nil, err

@ -8,11 +8,11 @@ import (
// TestUpdateStakingList creates a bls key with passphrase and compare it with the one loaded from the generated file. // TestUpdateStakingList creates a bls key with passphrase and compare it with the one loaded from the generated file.
func TestUpdateStakingList(t *testing.T) { func TestUpdateStakingList(t *testing.T) {
var err error var err error
privateKey, fileName, err := GenBlsKeyWithPassPhrase("abcd") privateKey, fileName, err := GenBLSKeyWithPassPhrase("abcd")
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
anotherPriKey, err := LoadBlsKeyWithPassPhrase(fileName, "abcd") anotherPriKey, err := LoadBLSKeyWithPassPhrase(fileName, "abcd")
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }

@ -157,7 +157,7 @@ func AccumulateRewards(
for beaconMember := range payable { for beaconMember := range payable {
// TODO Give out whatever leftover to the last voter/handle // TODO Give out whatever leftover to the last voter/handle
// what to do about share of those that didn't sign // what to do about share of those that didn't sign
voter := votingPower.Voters[payable[beaconMember].BlsPublicKey] voter := votingPower.Voters[payable[beaconMember].BLSPublicKey]
if !voter.IsHarmonyNode { if !voter.IsHarmonyNode {
snapshot, err := bc.ReadValidatorSnapshot(voter.EarningAccount) snapshot, err := bc.ReadValidatorSnapshot(voter.EarningAccount)
if err != nil { if err != nil {
@ -239,7 +239,7 @@ func AccumulateRewards(
shardExternalShare := shard.Schedule.InstanceForEpoch(cxLink.Epoch()).ExternalVotePercent() shardExternalShare := shard.Schedule.InstanceForEpoch(cxLink.Epoch()).ExternalVotePercent()
for j := range payableSigners { for j := range payableSigners {
voter := votingPower.Voters[payableSigners[j].BlsPublicKey] voter := votingPower.Voters[payableSigners[j].BLSPublicKey]
if !voter.IsHarmonyNode && !voter.OverallPercent.IsZero() { if !voter.IsHarmonyNode && !voter.OverallPercent.IsZero() {
due := defaultReward.Mul( due := defaultReward.Mul(
voter.OverallPercent.Quo(shardExternalShare), voter.OverallPercent.Quo(shardExternalShare),

@ -294,7 +294,7 @@ func SetShardingSchedule(schedule shardingconfig.Schedule) {
// ShardIDFromConsensusKey returns the shard ID statically determined from the // ShardIDFromConsensusKey returns the shard ID statically determined from the
// consensus key. // consensus key.
func (conf *ConfigType) ShardIDFromConsensusKey() (uint32, error) { func (conf *ConfigType) ShardIDFromConsensusKey() (uint32, error) {
var pubKey shard.BlsPublicKey var pubKey shard.BLSPublicKey
// all keys belong to same shard // all keys belong to same shard
if err := pubKey.FromLibBLSPublicKey(conf.ConsensusPubKey.PublicKey[0]); err != nil { if err := pubKey.FromLibBLSPublicKey(conf.ConsensusPubKey.PublicKey[0]); err != nil {
return 0, errors.Wrapf(err, return 0, errors.Wrapf(err,
@ -309,7 +309,7 @@ func (conf *ConfigType) ShardIDFromConsensusKey() (uint32, error) {
// ValidateConsensusKeysForSameShard checks if all consensus public keys belong to the same shard // ValidateConsensusKeysForSameShard checks if all consensus public keys belong to the same shard
func (conf *ConfigType) ValidateConsensusKeysForSameShard(pubkeys []*bls.PublicKey, sID uint32) error { func (conf *ConfigType) ValidateConsensusKeysForSameShard(pubkeys []*bls.PublicKey, sID uint32) error {
var pubKey shard.BlsPublicKey var pubKey shard.BLSPublicKey
for _, key := range pubkeys { for _, key := range pubkeys {
if err := pubKey.FromLibBLSPublicKey(key); err != nil { if err := pubKey.FromLibBLSPublicKey(key); err != nil {
return errors.Wrapf(err, return errors.Wrapf(err,

@ -145,13 +145,13 @@ func TestValidateConsensusKeysForSameShard(t *testing.T) {
// import two keys that belong to same shard and test ValidateConsensusKeysForSameShard // import two keys that belong to same shard and test ValidateConsensusKeysForSameShard
keyPath1 := "../../../.hmy/65f55eb3052f9e9f632b2923be594ba77c55543f5c58ee1454b9cfd658d25e06373b0f7d42a19c84768139ea294f6204.key" keyPath1 := "../../../.hmy/65f55eb3052f9e9f632b2923be594ba77c55543f5c58ee1454b9cfd658d25e06373b0f7d42a19c84768139ea294f6204.key"
priKey1, err := blsgen.LoadBlsKeyWithPassPhrase(keyPath1, "") priKey1, err := blsgen.LoadBLSKeyWithPassPhrase(keyPath1, "")
pubKey1 := priKey1.GetPublicKey() pubKey1 := priKey1.GetPublicKey()
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
keyPath2 := "../../../.hmy/ca86e551ee42adaaa6477322d7db869d3e203c00d7b86c82ebee629ad79cb6d57b8f3db28336778ec2180e56a8e07296.key" keyPath2 := "../../../.hmy/ca86e551ee42adaaa6477322d7db869d3e203c00d7b86c82ebee629ad79cb6d57b8f3db28336778ec2180e56a8e07296.key"
priKey2, err := blsgen.LoadBlsKeyWithPassPhrase(keyPath2, "") priKey2, err := blsgen.LoadBLSKeyWithPassPhrase(keyPath2, "")
pubKey2 := priKey2.GetPublicKey() pubKey2 := priKey2.GetPublicKey()
if err != nil { if err != nil {
t.Error(err) t.Error(err)
@ -164,7 +164,7 @@ func TestValidateConsensusKeysForSameShard(t *testing.T) {
} }
// add third key in different shard and test ValidateConsensusKeysForSameShard // add third key in different shard and test ValidateConsensusKeysForSameShard
keyPath3 := "../../../.hmy/68ae289d73332872ec8d04ac256ca0f5453c88ad392730c5741b6055bc3ec3d086ab03637713a29f459177aaa8340615.key" keyPath3 := "../../../.hmy/68ae289d73332872ec8d04ac256ca0f5453c88ad392730c5741b6055bc3ec3d086ab03637713a29f459177aaa8340615.key"
priKey3, err := blsgen.LoadBlsKeyWithPassPhrase(keyPath3, "") priKey3, err := blsgen.LoadBLSKeyWithPassPhrase(keyPath3, "")
pubKey3 := priKey3.GetPublicKey() pubKey3 := priKey3.GetPublicKey()
if err != nil { if err != nil {
t.Error(err) t.Error(err)

@ -144,13 +144,13 @@ func (sc instance) FnAccounts() []genesis.DeployAccount {
// or not in the bootstrapping process. // or not in the bootstrapping process.
func (sc instance) FindAccount(blsPubKey string) (bool, *genesis.DeployAccount) { func (sc instance) FindAccount(blsPubKey string) (bool, *genesis.DeployAccount) {
for i, item := range sc.hmyAccounts { for i, item := range sc.hmyAccounts {
if item.BlsPublicKey == blsPubKey { if item.BLSPublicKey == blsPubKey {
item.ShardID = uint32(i) % sc.numShards item.ShardID = uint32(i) % sc.numShards
return uint32(i) < sc.numShards, &item return uint32(i) < sc.numShards, &item
} }
} }
for i, item := range sc.fnAccounts { for i, item := range sc.fnAccounts {
if item.BlsPublicKey == blsPubKey { if item.BLSPublicKey == blsPubKey {
item.ShardID = uint32(i) % sc.numShards item.ShardID = uint32(i) % sc.numShards
return false, &item return false, &item
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -16,12 +16,12 @@ const genesisString = "https://harmony.one 'Open Consensus for 10B' 2019.06.01 $
type DeployAccount struct { type DeployAccount struct {
Index string // index Index string // index
Address string // account address Address string // account address
BlsPublicKey string // account public BLS key BLSPublicKey string // account public BLS key
ShardID uint32 // shardID of the account ShardID uint32 // shardID of the account
} }
func (d DeployAccount) String() string { func (d DeployAccount) String() string {
return fmt.Sprintf("%s/%s:%d", d.Address, d.BlsPublicKey, d.ShardID) return fmt.Sprintf("%s/%s:%d", d.Address, d.BLSPublicKey, d.ShardID)
} }
// BeaconAccountPriKey is the func which generates a constant private key. // BeaconAccountPriKey is the func which generates a constant private key.

@ -47,7 +47,7 @@ func testGenesisccounts(t *testing.T) {
index := 404 index := 404
for i, one := range ones { for i, one := range ones {
fmt.Printf(" {Index: \" %v \", Address: \"%v\", BlsPublicKey: \"%v\"},\n", index, one, bls[i]) fmt.Printf(" {Index: \" %v \", Address: \"%v\", BLSPublicKey: \"%v\"},\n", index, one, bls[i])
index++ index++
} }
} }
@ -81,9 +81,9 @@ func testAccounts(test *testing.T, accounts []DeployAccount) {
} }
pubKey := bls.PublicKey{} pubKey := bls.PublicKey{}
err = pubKey.DeserializeHexStr(account.BlsPublicKey) err = pubKey.DeserializeHexStr(account.BLSPublicKey)
if err != nil { if err != nil {
test.Error("Account bls public key", account.BlsPublicKey, "is not valid:", err) test.Error("Account bls public key", account.BLSPublicKey, "is not valid:", err)
} }
} }
} }
@ -103,7 +103,7 @@ func testDeployAccounts(t *testing.T, accounts []DeployAccount) {
indicesByAddress[address] = append(indicesByAddress[address], index) indicesByAddress[address] = append(indicesByAddress[address], index)
} }
pubKey := bls.PublicKey{} pubKey := bls.PublicKey{}
if err := pubKey.DeserializeHexStr(account.BlsPublicKey); err != nil { if err := pubKey.DeserializeHexStr(account.BLSPublicKey); err != nil {
t.Errorf("account %+v at index %v has invalid public key (%s)", t.Errorf("account %+v at index %v has invalid public key (%s)",
account, index, err) account, index, err)
} else { } else {

File diff suppressed because it is too large Load Diff

@ -1,17 +1,56 @@
import argparse import argparse
if __name__ == "__main__": if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Create Foundational Keys List from Internal Record.') parser = argparse.ArgumentParser(
parser.add_argument('-sheet', default='allkeys-sheet.txt', dest = 'sheet',help='tab seperate ecdsa and bls keys',type=str) description="Create Foundational Keys List from Internal Record."
parser.add_argument('-foundational', default = 'allkeys-foundational-go.txt', dest = 'foundational',help='file compatible with foundational go',type=str) )
parser.add_argument('-index', default = 0, dest = 'index',help='index of where you want to start from',type=int) parser.add_argument(
"-sheet",
default="allkeys-sheet.txt",
dest="sheet",
help="tab seperate ecdsa and bls keys",
type=str,
)
parser.add_argument(
"-foundational",
default="allkeys-foundational-go.txt",
dest="foundational",
help="file compatible with foundational go",
type=str,
)
parser.add_argument(
"-index",
default=0,
dest="index",
help="index of where you want to start from",
type=int,
)
args = parser.parse_args() args = parser.parse_args()
g = open(args.sheet,"r") g = open(args.sheet, "r")
f = open(args.foundational,"w") f = open(args.foundational, "w")
index= args.index index = args.index
for myline in g: for myline in g:
ecdsa,bls = myline.strip().split("\t") ecdsa, bls = myline.strip().split("\t")
string = '{Index:' + '"' + str(index) + '"' + ',' + ' ' + 'Address:' + '"'+ ecdsa + '"' + ',' + ' ' + 'BlsPublicKey:' + '"' + bls + '"'+ '}' + ',' string = (
f.write(string+"\n") "{Index:"
+ '"'
+ str(index)
+ '"'
+ ","
+ " "
+ "Address:"
+ '"'
+ ecdsa
+ '"'
+ ","
+ " "
+ "BLSPublicKey:"
+ '"'
+ bls
+ '"'
+ "}"
+ ","
)
f.write(string + "\n")
index = index + 1 index = index + 1
g.close() g.close()

@ -2,76 +2,76 @@ package genesis
// LocalHarmonyAccounts are the accounts for the initial genesis nodes used for local test. // LocalHarmonyAccounts are the accounts for the initial genesis nodes used for local test.
var LocalHarmonyAccounts = []DeployAccount{ var LocalHarmonyAccounts = []DeployAccount{
{Index: " 0 ", Address: "one1pdv9lrdwl0rg5vglh4xtyrv3wjk3wsqket7zxy", BlsPublicKey: "65f55eb3052f9e9f632b2923be594ba77c55543f5c58ee1454b9cfd658d25e06373b0f7d42a19c84768139ea294f6204"}, {Index: " 0 ", Address: "one1pdv9lrdwl0rg5vglh4xtyrv3wjk3wsqket7zxy", BLSPublicKey: "65f55eb3052f9e9f632b2923be594ba77c55543f5c58ee1454b9cfd658d25e06373b0f7d42a19c84768139ea294f6204"},
{Index: " 1 ", Address: "one1m6m0ll3q7ljdqgmth2t5j7dfe6stykucpj2nr5", BlsPublicKey: "40379eed79ed82bebfb4310894fd33b6a3f8413a78dc4d43b98d0adc9ef69f3285df05eaab9f2ce5f7227f8cb920e809"}, {Index: " 1 ", Address: "one1m6m0ll3q7ljdqgmth2t5j7dfe6stykucpj2nr5", BLSPublicKey: "40379eed79ed82bebfb4310894fd33b6a3f8413a78dc4d43b98d0adc9ef69f3285df05eaab9f2ce5f7227f8cb920e809"},
{Index: " 2 ", Address: "one12fuf7x9rgtdgqg7vgq0962c556m3p7afsxgvll", BlsPublicKey: "02c8ff0b88f313717bc3a627d2f8bb172ba3ad3bb9ba3ecb8eed4b7c878653d3d4faf769876c528b73f343967f74a917"}, {Index: " 2 ", Address: "one12fuf7x9rgtdgqg7vgq0962c556m3p7afsxgvll", BLSPublicKey: "02c8ff0b88f313717bc3a627d2f8bb172ba3ad3bb9ba3ecb8eed4b7c878653d3d4faf769876c528b73f343967f74a917"},
{Index: " 3 ", Address: "one16qsd5ant9v94jrs89mruzx62h7ekcfxmduh2rx", BlsPublicKey: "ee2474f93cba9241562efc7475ac2721ab0899edf8f7f115a656c0c1f9ef8203add678064878d174bb478fa2e6630502"}, {Index: " 3 ", Address: "one16qsd5ant9v94jrs89mruzx62h7ekcfxmduh2rx", BLSPublicKey: "ee2474f93cba9241562efc7475ac2721ab0899edf8f7f115a656c0c1f9ef8203add678064878d174bb478fa2e6630502"},
{Index: " 4 ", Address: "one1pf75h0t4am90z8uv3y0dgunfqp4lj8wr3t5rsp", BlsPublicKey: "e751ec995defe4931273aaebcb2cd14bf37e629c554a57d3f334c37881a34a6188a93e76113c55ef3481da23b7d7ab09"}, {Index: " 4 ", Address: "one1pf75h0t4am90z8uv3y0dgunfqp4lj8wr3t5rsp", BLSPublicKey: "e751ec995defe4931273aaebcb2cd14bf37e629c554a57d3f334c37881a34a6188a93e76113c55ef3481da23b7d7ab09"},
{Index: " 5 ", Address: "one1est2gxcvavmtnzc7mhd73gzadm3xxcv5zczdtw", BlsPublicKey: "776f3b8704f4e1092a302a60e84f81e476c212d6f458092b696df420ea19ff84a6179e8e23d090b9297dc041600bc100"}, {Index: " 5 ", Address: "one1est2gxcvavmtnzc7mhd73gzadm3xxcv5zczdtw", BLSPublicKey: "776f3b8704f4e1092a302a60e84f81e476c212d6f458092b696df420ea19ff84a6179e8e23d090b9297dc041600bc100"},
{Index: " 6 ", Address: "one1spshr72utf6rwxseaz339j09ed8p6f8ke370zj", BlsPublicKey: "2d61379e44a772e5757e27ee2b3874254f56073e6bd226eb8b160371cc3c18b8c4977bd3dcb71fd57dc62bf0e143fd08"}, {Index: " 6 ", Address: "one1spshr72utf6rwxseaz339j09ed8p6f8ke370zj", BLSPublicKey: "2d61379e44a772e5757e27ee2b3874254f56073e6bd226eb8b160371cc3c18b8c4977bd3dcb71fd57dc62bf0e143fd08"},
{Index: " 7 ", Address: "one1a0x3d6xpmr6f8wsyaxd9v36pytvp48zckswvv9", BlsPublicKey: "c4e4708b6cf2a2ceeb59981677e9821eebafc5cf483fb5364a28fa604cc0ce69beeed40f3f03815c9e196fdaec5f1097"}, {Index: " 7 ", Address: "one1a0x3d6xpmr6f8wsyaxd9v36pytvp48zckswvv9", BLSPublicKey: "c4e4708b6cf2a2ceeb59981677e9821eebafc5cf483fb5364a28fa604cc0ce69beeed40f3f03815c9e196fdaec5f1097"},
{Index: " 8 ", Address: "one1d2rngmem4x2c6zxsjjz29dlah0jzkr0k2n88wc", BlsPublicKey: "86dc2fdc2ceec18f6923b99fd86a68405c132e1005cf1df72dca75db0adfaeb53d201d66af37916d61f079f34f21fb96"}, {Index: " 8 ", Address: "one1d2rngmem4x2c6zxsjjz29dlah0jzkr0k2n88wc", BLSPublicKey: "86dc2fdc2ceec18f6923b99fd86a68405c132e1005cf1df72dca75db0adfaeb53d201d66af37916d61f079f34f21fb96"},
{Index: " 9 ", Address: "one1658znfwf40epvy7e46cqrmzyy54h4n0qa73nep", BlsPublicKey: "49d15743b36334399f9985feb0753430a2b287b2d68b84495bbb15381854cbf01bca9d1d9f4c9c8f18509b2bfa6bd40f"}, {Index: " 9 ", Address: "one1658znfwf40epvy7e46cqrmzyy54h4n0qa73nep", BLSPublicKey: "49d15743b36334399f9985feb0753430a2b287b2d68b84495bbb15381854cbf01bca9d1d9f4c9c8f18509b2bfa6bd40f"},
} }
// LocalFnAccounts are the accounts for the initial FN used for local test. // LocalFnAccounts are the accounts for the initial FN used for local test.
var LocalFnAccounts = []DeployAccount{ var LocalFnAccounts = []DeployAccount{
{Index: " 0 ", Address: "one1a50tun737ulcvwy0yvve0pvu5skq0kjargvhwe", BlsPublicKey: "52ecce5f64db21cbe374c9268188f5d2cdd5bec1a3112276a350349860e35fb81f8cfe447a311e0550d961cf25cb988d"}, {Index: " 0 ", Address: "one1a50tun737ulcvwy0yvve0pvu5skq0kjargvhwe", BLSPublicKey: "52ecce5f64db21cbe374c9268188f5d2cdd5bec1a3112276a350349860e35fb81f8cfe447a311e0550d961cf25cb988d"},
{Index: " 1 ", Address: "one1uyshu2jgv8w465yc8kkny36thlt2wvel89tcmg", BlsPublicKey: "a547a9bf6fdde4f4934cde21473748861a3cc0fe8bbb5e57225a29f483b05b72531f002f8187675743d819c955a86100"}, {Index: " 1 ", Address: "one1uyshu2jgv8w465yc8kkny36thlt2wvel89tcmg", BLSPublicKey: "a547a9bf6fdde4f4934cde21473748861a3cc0fe8bbb5e57225a29f483b05b72531f002f8187675743d819c955a86100"},
{Index: " 2 ", Address: "one103q7qe5t2505lypvltkqtddaef5tzfxwsse4z7", BlsPublicKey: "678ec9670899bf6af85b877058bea4fc1301a5a3a376987e826e3ca150b80e3eaadffedad0fedfa111576fa76ded980c"}, {Index: " 2 ", Address: "one103q7qe5t2505lypvltkqtddaef5tzfxwsse4z7", BLSPublicKey: "678ec9670899bf6af85b877058bea4fc1301a5a3a376987e826e3ca150b80e3eaadffedad0fedfa111576fa76ded980c"},
{Index: " 3 ", Address: "one129r9pj3sk0re76f7zs3qz92rggmdgjhtwge62k", BlsPublicKey: "63f479f249c59f0486fda8caa2ffb247209489dae009dfde6144ff38c370230963d360dffd318cfb26c213320e89a512"}, {Index: " 3 ", Address: "one129r9pj3sk0re76f7zs3qz92rggmdgjhtwge62k", BLSPublicKey: "63f479f249c59f0486fda8caa2ffb247209489dae009dfde6144ff38c370230963d360dffd318cfb26c213320e89a512"},
} }
// LocalHarmonyAccountsV1 are the accounts for the initial genesis nodes used for local test. // LocalHarmonyAccountsV1 are the accounts for the initial genesis nodes used for local test.
var LocalHarmonyAccountsV1 = []DeployAccount{ var LocalHarmonyAccountsV1 = []DeployAccount{
{Index: " 0 ", Address: "one1pdv9lrdwl0rg5vglh4xtyrv3wjk3wsqket7zxy", BlsPublicKey: "65f55eb3052f9e9f632b2923be594ba77c55543f5c58ee1454b9cfd658d25e06373b0f7d42a19c84768139ea294f6204"}, {Index: " 0 ", Address: "one1pdv9lrdwl0rg5vglh4xtyrv3wjk3wsqket7zxy", BLSPublicKey: "65f55eb3052f9e9f632b2923be594ba77c55543f5c58ee1454b9cfd658d25e06373b0f7d42a19c84768139ea294f6204"},
{Index: " 1 ", Address: "one1m6m0ll3q7ljdqgmth2t5j7dfe6stykucpj2nr5", BlsPublicKey: "40379eed79ed82bebfb4310894fd33b6a3f8413a78dc4d43b98d0adc9ef69f3285df05eaab9f2ce5f7227f8cb920e809"}, {Index: " 1 ", Address: "one1m6m0ll3q7ljdqgmth2t5j7dfe6stykucpj2nr5", BLSPublicKey: "40379eed79ed82bebfb4310894fd33b6a3f8413a78dc4d43b98d0adc9ef69f3285df05eaab9f2ce5f7227f8cb920e809"},
{Index: " 2 ", Address: "one12fuf7x9rgtdgqg7vgq0962c556m3p7afsxgvll", BlsPublicKey: "02c8ff0b88f313717bc3a627d2f8bb172ba3ad3bb9ba3ecb8eed4b7c878653d3d4faf769876c528b73f343967f74a917"}, {Index: " 2 ", Address: "one12fuf7x9rgtdgqg7vgq0962c556m3p7afsxgvll", BLSPublicKey: "02c8ff0b88f313717bc3a627d2f8bb172ba3ad3bb9ba3ecb8eed4b7c878653d3d4faf769876c528b73f343967f74a917"},
{Index: " 3 ", Address: "one16qsd5ant9v94jrs89mruzx62h7ekcfxmduh2rx", BlsPublicKey: "ee2474f93cba9241562efc7475ac2721ab0899edf8f7f115a656c0c1f9ef8203add678064878d174bb478fa2e6630502"}, {Index: " 3 ", Address: "one16qsd5ant9v94jrs89mruzx62h7ekcfxmduh2rx", BLSPublicKey: "ee2474f93cba9241562efc7475ac2721ab0899edf8f7f115a656c0c1f9ef8203add678064878d174bb478fa2e6630502"},
{Index: " 4 ", Address: "one1pf75h0t4am90z8uv3y0dgunfqp4lj8wr3t5rsp", BlsPublicKey: "e751ec995defe4931273aaebcb2cd14bf37e629c554a57d3f334c37881a34a6188a93e76113c55ef3481da23b7d7ab09"}, {Index: " 4 ", Address: "one1pf75h0t4am90z8uv3y0dgunfqp4lj8wr3t5rsp", BLSPublicKey: "e751ec995defe4931273aaebcb2cd14bf37e629c554a57d3f334c37881a34a6188a93e76113c55ef3481da23b7d7ab09"},
{Index: " 5 ", Address: "one1est2gxcvavmtnzc7mhd73gzadm3xxcv5zczdtw", BlsPublicKey: "776f3b8704f4e1092a302a60e84f81e476c212d6f458092b696df420ea19ff84a6179e8e23d090b9297dc041600bc100"}, {Index: " 5 ", Address: "one1est2gxcvavmtnzc7mhd73gzadm3xxcv5zczdtw", BLSPublicKey: "776f3b8704f4e1092a302a60e84f81e476c212d6f458092b696df420ea19ff84a6179e8e23d090b9297dc041600bc100"},
{Index: " 6 ", Address: "one1spshr72utf6rwxseaz339j09ed8p6f8ke370zj", BlsPublicKey: "2d61379e44a772e5757e27ee2b3874254f56073e6bd226eb8b160371cc3c18b8c4977bd3dcb71fd57dc62bf0e143fd08"}, {Index: " 6 ", Address: "one1spshr72utf6rwxseaz339j09ed8p6f8ke370zj", BLSPublicKey: "2d61379e44a772e5757e27ee2b3874254f56073e6bd226eb8b160371cc3c18b8c4977bd3dcb71fd57dc62bf0e143fd08"},
{Index: " 7 ", Address: "one1a0x3d6xpmr6f8wsyaxd9v36pytvp48zckswvv9", BlsPublicKey: "c4e4708b6cf2a2ceeb59981677e9821eebafc5cf483fb5364a28fa604cc0ce69beeed40f3f03815c9e196fdaec5f1097"}, {Index: " 7 ", Address: "one1a0x3d6xpmr6f8wsyaxd9v36pytvp48zckswvv9", BLSPublicKey: "c4e4708b6cf2a2ceeb59981677e9821eebafc5cf483fb5364a28fa604cc0ce69beeed40f3f03815c9e196fdaec5f1097"},
{Index: " 8 ", Address: "one1d2rngmem4x2c6zxsjjz29dlah0jzkr0k2n88wc", BlsPublicKey: "86dc2fdc2ceec18f6923b99fd86a68405c132e1005cf1df72dca75db0adfaeb53d201d66af37916d61f079f34f21fb96"}, {Index: " 8 ", Address: "one1d2rngmem4x2c6zxsjjz29dlah0jzkr0k2n88wc", BLSPublicKey: "86dc2fdc2ceec18f6923b99fd86a68405c132e1005cf1df72dca75db0adfaeb53d201d66af37916d61f079f34f21fb96"},
{Index: " 9 ", Address: "one1658znfwf40epvy7e46cqrmzyy54h4n0qa73nep", BlsPublicKey: "49d15743b36334399f9985feb0753430a2b287b2d68b84495bbb15381854cbf01bca9d1d9f4c9c8f18509b2bfa6bd40f"}, {Index: " 9 ", Address: "one1658znfwf40epvy7e46cqrmzyy54h4n0qa73nep", BLSPublicKey: "49d15743b36334399f9985feb0753430a2b287b2d68b84495bbb15381854cbf01bca9d1d9f4c9c8f18509b2bfa6bd40f"},
} }
// LocalFnAccountsV1 are the accounts for the initial FN used for local test. // LocalFnAccountsV1 are the accounts for the initial FN used for local test.
var LocalFnAccountsV1 = []DeployAccount{ var LocalFnAccountsV1 = []DeployAccount{
{Index: " 0 ", Address: "one1a50tun737ulcvwy0yvve0pvu5skq0kjargvhwe", BlsPublicKey: "52ecce5f64db21cbe374c9268188f5d2cdd5bec1a3112276a350349860e35fb81f8cfe447a311e0550d961cf25cb988d"}, {Index: " 0 ", Address: "one1a50tun737ulcvwy0yvve0pvu5skq0kjargvhwe", BLSPublicKey: "52ecce5f64db21cbe374c9268188f5d2cdd5bec1a3112276a350349860e35fb81f8cfe447a311e0550d961cf25cb988d"},
{Index: " 1 ", Address: "one1uyshu2jgv8w465yc8kkny36thlt2wvel89tcmg", BlsPublicKey: "a547a9bf6fdde4f4934cde21473748861a3cc0fe8bbb5e57225a29f483b05b72531f002f8187675743d819c955a86100"}, {Index: " 1 ", Address: "one1uyshu2jgv8w465yc8kkny36thlt2wvel89tcmg", BLSPublicKey: "a547a9bf6fdde4f4934cde21473748861a3cc0fe8bbb5e57225a29f483b05b72531f002f8187675743d819c955a86100"},
{Index: " 2 ", Address: "one103q7qe5t2505lypvltkqtddaef5tzfxwsse4z7", BlsPublicKey: "678ec9670899bf6af85b877058bea4fc1301a5a3a376987e826e3ca150b80e3eaadffedad0fedfa111576fa76ded980c"}, {Index: " 2 ", Address: "one103q7qe5t2505lypvltkqtddaef5tzfxwsse4z7", BLSPublicKey: "678ec9670899bf6af85b877058bea4fc1301a5a3a376987e826e3ca150b80e3eaadffedad0fedfa111576fa76ded980c"},
{Index: " 3 ", Address: "one129r9pj3sk0re76f7zs3qz92rggmdgjhtwge62k", BlsPublicKey: "63f479f249c59f0486fda8caa2ffb247209489dae009dfde6144ff38c370230963d360dffd318cfb26c213320e89a512"}, {Index: " 3 ", Address: "one129r9pj3sk0re76f7zs3qz92rggmdgjhtwge62k", BLSPublicKey: "63f479f249c59f0486fda8caa2ffb247209489dae009dfde6144ff38c370230963d360dffd318cfb26c213320e89a512"},
{Index: " 4 ", Address: "one1d2rngmem4x2c6zxsjjz29dlah0jzkr0k2n88wc", BlsPublicKey: "16513c487a6bb76f37219f3c2927a4f281f9dd3fd6ed2e3a64e500de6545cf391dd973cc228d24f9bd01efe94912e714"}, {Index: " 4 ", Address: "one1d2rngmem4x2c6zxsjjz29dlah0jzkr0k2n88wc", BLSPublicKey: "16513c487a6bb76f37219f3c2927a4f281f9dd3fd6ed2e3a64e500de6545cf391dd973cc228d24f9bd01efe94912e714"},
{Index: " 5 ", Address: "one1658znfwf40epvy7e46cqrmzyy54h4n0qa73nep", BlsPublicKey: "576d3c48294e00d6be4a22b07b66a870ddee03052fe48a5abbd180222e5d5a1f8946a78d55b025de21635fd743bbad90"}, {Index: " 5 ", Address: "one1658znfwf40epvy7e46cqrmzyy54h4n0qa73nep", BLSPublicKey: "576d3c48294e00d6be4a22b07b66a870ddee03052fe48a5abbd180222e5d5a1f8946a78d55b025de21635fd743bbad90"},
} }
// LocalHarmonyAccountsV2 are the accounts for the initial genesis nodes used for local test. // LocalHarmonyAccountsV2 are the accounts for the initial genesis nodes used for local test.
var LocalHarmonyAccountsV2 = []DeployAccount{ var LocalHarmonyAccountsV2 = []DeployAccount{
{Index: " 0 ", Address: "one1pdv9lrdwl0rg5vglh4xtyrv3wjk3wsqket7zxy", BlsPublicKey: "65f55eb3052f9e9f632b2923be594ba77c55543f5c58ee1454b9cfd658d25e06373b0f7d42a19c84768139ea294f6204"}, {Index: " 0 ", Address: "one1pdv9lrdwl0rg5vglh4xtyrv3wjk3wsqket7zxy", BLSPublicKey: "65f55eb3052f9e9f632b2923be594ba77c55543f5c58ee1454b9cfd658d25e06373b0f7d42a19c84768139ea294f6204"},
{Index: " 1 ", Address: "one1m6m0ll3q7ljdqgmth2t5j7dfe6stykucpj2nr5", BlsPublicKey: "40379eed79ed82bebfb4310894fd33b6a3f8413a78dc4d43b98d0adc9ef69f3285df05eaab9f2ce5f7227f8cb920e809"}, {Index: " 1 ", Address: "one1m6m0ll3q7ljdqgmth2t5j7dfe6stykucpj2nr5", BLSPublicKey: "40379eed79ed82bebfb4310894fd33b6a3f8413a78dc4d43b98d0adc9ef69f3285df05eaab9f2ce5f7227f8cb920e809"},
{Index: " 2 ", Address: "one12fuf7x9rgtdgqg7vgq0962c556m3p7afsxgvll", BlsPublicKey: "02c8ff0b88f313717bc3a627d2f8bb172ba3ad3bb9ba3ecb8eed4b7c878653d3d4faf769876c528b73f343967f74a917"}, {Index: " 2 ", Address: "one12fuf7x9rgtdgqg7vgq0962c556m3p7afsxgvll", BLSPublicKey: "02c8ff0b88f313717bc3a627d2f8bb172ba3ad3bb9ba3ecb8eed4b7c878653d3d4faf769876c528b73f343967f74a917"},
{Index: " 3 ", Address: "one16qsd5ant9v94jrs89mruzx62h7ekcfxmduh2rx", BlsPublicKey: "ee2474f93cba9241562efc7475ac2721ab0899edf8f7f115a656c0c1f9ef8203add678064878d174bb478fa2e6630502"}, {Index: " 3 ", Address: "one16qsd5ant9v94jrs89mruzx62h7ekcfxmduh2rx", BLSPublicKey: "ee2474f93cba9241562efc7475ac2721ab0899edf8f7f115a656c0c1f9ef8203add678064878d174bb478fa2e6630502"},
{Index: " 4 ", Address: "one1pf75h0t4am90z8uv3y0dgunfqp4lj8wr3t5rsp", BlsPublicKey: "e751ec995defe4931273aaebcb2cd14bf37e629c554a57d3f334c37881a34a6188a93e76113c55ef3481da23b7d7ab09"}, {Index: " 4 ", Address: "one1pf75h0t4am90z8uv3y0dgunfqp4lj8wr3t5rsp", BLSPublicKey: "e751ec995defe4931273aaebcb2cd14bf37e629c554a57d3f334c37881a34a6188a93e76113c55ef3481da23b7d7ab09"},
{Index: " 5 ", Address: "one1est2gxcvavmtnzc7mhd73gzadm3xxcv5zczdtw", BlsPublicKey: "776f3b8704f4e1092a302a60e84f81e476c212d6f458092b696df420ea19ff84a6179e8e23d090b9297dc041600bc100"}, {Index: " 5 ", Address: "one1est2gxcvavmtnzc7mhd73gzadm3xxcv5zczdtw", BLSPublicKey: "776f3b8704f4e1092a302a60e84f81e476c212d6f458092b696df420ea19ff84a6179e8e23d090b9297dc041600bc100"},
{Index: " 6 ", Address: "one1spshr72utf6rwxseaz339j09ed8p6f8ke370zj", BlsPublicKey: "2d61379e44a772e5757e27ee2b3874254f56073e6bd226eb8b160371cc3c18b8c4977bd3dcb71fd57dc62bf0e143fd08"}, {Index: " 6 ", Address: "one1spshr72utf6rwxseaz339j09ed8p6f8ke370zj", BLSPublicKey: "2d61379e44a772e5757e27ee2b3874254f56073e6bd226eb8b160371cc3c18b8c4977bd3dcb71fd57dc62bf0e143fd08"},
{Index: " 7 ", Address: "one1a0x3d6xpmr6f8wsyaxd9v36pytvp48zckswvv9", BlsPublicKey: "c4e4708b6cf2a2ceeb59981677e9821eebafc5cf483fb5364a28fa604cc0ce69beeed40f3f03815c9e196fdaec5f1097"}, {Index: " 7 ", Address: "one1a0x3d6xpmr6f8wsyaxd9v36pytvp48zckswvv9", BLSPublicKey: "c4e4708b6cf2a2ceeb59981677e9821eebafc5cf483fb5364a28fa604cc0ce69beeed40f3f03815c9e196fdaec5f1097"},
{Index: " 8 ", Address: "one1d2rngmem4x2c6zxsjjz29dlah0jzkr0k2n88wc", BlsPublicKey: "86dc2fdc2ceec18f6923b99fd86a68405c132e1005cf1df72dca75db0adfaeb53d201d66af37916d61f079f34f21fb96"}, {Index: " 8 ", Address: "one1d2rngmem4x2c6zxsjjz29dlah0jzkr0k2n88wc", BLSPublicKey: "86dc2fdc2ceec18f6923b99fd86a68405c132e1005cf1df72dca75db0adfaeb53d201d66af37916d61f079f34f21fb96"},
{Index: " 9 ", Address: "one1658znfwf40epvy7e46cqrmzyy54h4n0qa73nep", BlsPublicKey: "49d15743b36334399f9985feb0753430a2b287b2d68b84495bbb15381854cbf01bca9d1d9f4c9c8f18509b2bfa6bd40f"}, {Index: " 9 ", Address: "one1658znfwf40epvy7e46cqrmzyy54h4n0qa73nep", BLSPublicKey: "49d15743b36334399f9985feb0753430a2b287b2d68b84495bbb15381854cbf01bca9d1d9f4c9c8f18509b2bfa6bd40f"},
{Index: " 10 ", Address: "one1z05g55zamqzfw9qs432n33gycdmyvs38xjemyl", BlsPublicKey: "95117937cd8c09acd2dfae847d74041a67834ea88662a7cbed1e170350bc329e53db151e5a0ef3e712e35287ae954818"}, {Index: " 10 ", Address: "one1z05g55zamqzfw9qs432n33gycdmyvs38xjemyl", BLSPublicKey: "95117937cd8c09acd2dfae847d74041a67834ea88662a7cbed1e170350bc329e53db151e5a0ef3e712e35287ae954818"},
{Index: " 11 ", Address: "one1ljznytjyn269azvszjlcqvpcj6hjm822yrcp2e", BlsPublicKey: "68ae289d73332872ec8d04ac256ca0f5453c88ad392730c5741b6055bc3ec3d086ab03637713a29f459177aaa8340615"}, {Index: " 11 ", Address: "one1ljznytjyn269azvszjlcqvpcj6hjm822yrcp2e", BLSPublicKey: "68ae289d73332872ec8d04ac256ca0f5453c88ad392730c5741b6055bc3ec3d086ab03637713a29f459177aaa8340615"},
} }
// LocalFnAccountsV2 are the accounts for the initial FN used for local test. // LocalFnAccountsV2 are the accounts for the initial FN used for local test.
var LocalFnAccountsV2 = []DeployAccount{ var LocalFnAccountsV2 = []DeployAccount{
{Index: " 0 ", Address: "one1a50tun737ulcvwy0yvve0pvu5skq0kjargvhwe", BlsPublicKey: "52ecce5f64db21cbe374c9268188f5d2cdd5bec1a3112276a350349860e35fb81f8cfe447a311e0550d961cf25cb988d"}, {Index: " 0 ", Address: "one1a50tun737ulcvwy0yvve0pvu5skq0kjargvhwe", BLSPublicKey: "52ecce5f64db21cbe374c9268188f5d2cdd5bec1a3112276a350349860e35fb81f8cfe447a311e0550d961cf25cb988d"},
{Index: " 1 ", Address: "one1uyshu2jgv8w465yc8kkny36thlt2wvel89tcmg", BlsPublicKey: "a547a9bf6fdde4f4934cde21473748861a3cc0fe8bbb5e57225a29f483b05b72531f002f8187675743d819c955a86100"}, {Index: " 1 ", Address: "one1uyshu2jgv8w465yc8kkny36thlt2wvel89tcmg", BLSPublicKey: "a547a9bf6fdde4f4934cde21473748861a3cc0fe8bbb5e57225a29f483b05b72531f002f8187675743d819c955a86100"},
{Index: " 2 ", Address: "one103q7qe5t2505lypvltkqtddaef5tzfxwsse4z7", BlsPublicKey: "678ec9670899bf6af85b877058bea4fc1301a5a3a376987e826e3ca150b80e3eaadffedad0fedfa111576fa76ded980c"}, {Index: " 2 ", Address: "one103q7qe5t2505lypvltkqtddaef5tzfxwsse4z7", BLSPublicKey: "678ec9670899bf6af85b877058bea4fc1301a5a3a376987e826e3ca150b80e3eaadffedad0fedfa111576fa76ded980c"},
{Index: " 3 ", Address: "one129r9pj3sk0re76f7zs3qz92rggmdgjhtwge62k", BlsPublicKey: "63f479f249c59f0486fda8caa2ffb247209489dae009dfde6144ff38c370230963d360dffd318cfb26c213320e89a512"}, {Index: " 3 ", Address: "one129r9pj3sk0re76f7zs3qz92rggmdgjhtwge62k", BLSPublicKey: "63f479f249c59f0486fda8caa2ffb247209489dae009dfde6144ff38c370230963d360dffd318cfb26c213320e89a512"},
{Index: " 4 ", Address: "one1d2rngmem4x2c6zxsjjz29dlah0jzkr0k2n88wc", BlsPublicKey: "16513c487a6bb76f37219f3c2927a4f281f9dd3fd6ed2e3a64e500de6545cf391dd973cc228d24f9bd01efe94912e714"}, {Index: " 4 ", Address: "one1d2rngmem4x2c6zxsjjz29dlah0jzkr0k2n88wc", BLSPublicKey: "16513c487a6bb76f37219f3c2927a4f281f9dd3fd6ed2e3a64e500de6545cf391dd973cc228d24f9bd01efe94912e714"},
{Index: " 5 ", Address: "one1658znfwf40epvy7e46cqrmzyy54h4n0qa73nep", BlsPublicKey: "576d3c48294e00d6be4a22b07b66a870ddee03052fe48a5abbd180222e5d5a1f8946a78d55b025de21635fd743bbad90"}, {Index: " 5 ", Address: "one1658znfwf40epvy7e46cqrmzyy54h4n0qa73nep", BLSPublicKey: "576d3c48294e00d6be4a22b07b66a870ddee03052fe48a5abbd180222e5d5a1f8946a78d55b025de21635fd743bbad90"},
{Index: " 6 ", Address: "one1ghkz3frhske7emk79p7v2afmj4a5t0kmjyt4s5", BlsPublicKey: "eca09c1808b729ca56f1b5a6a287c6e1c3ae09e29ccf7efa35453471fcab07d9f73cee249e2b91f5ee44eb9618be3904"}, {Index: " 6 ", Address: "one1ghkz3frhske7emk79p7v2afmj4a5t0kmjyt4s5", BLSPublicKey: "eca09c1808b729ca56f1b5a6a287c6e1c3ae09e29ccf7efa35453471fcab07d9f73cee249e2b91f5ee44eb9618be3904"},
{Index: " 7 ", Address: "one1d7jfnr6yraxnrycgaemyktkmhmajhp8kl0yahv", BlsPublicKey: "f47238daef97d60deedbde5302d05dea5de67608f11f406576e363661f7dcbc4a1385948549b31a6c70f6fde8a391486"}, {Index: " 7 ", Address: "one1d7jfnr6yraxnrycgaemyktkmhmajhp8kl0yahv", BLSPublicKey: "f47238daef97d60deedbde5302d05dea5de67608f11f406576e363661f7dcbc4a1385948549b31a6c70f6fde8a391486"},
{Index: " 8 ", Address: "one1r4zyyjqrulf935a479sgqlpa78kz7zlcg2jfen", BlsPublicKey: "fc4b9c535ee91f015efff3f32fbb9d32cdd9bfc8a837bb3eee89b8fff653c7af2050a4e147ebe5c7233dc2d5df06ee0a"}, {Index: " 8 ", Address: "one1r4zyyjqrulf935a479sgqlpa78kz7zlcg2jfen", BLSPublicKey: "fc4b9c535ee91f015efff3f32fbb9d32cdd9bfc8a837bb3eee89b8fff653c7af2050a4e147ebe5c7233dc2d5df06ee0a"},
{Index: " 9 ", Address: "one1p7ht2d4kl8ve7a8jxw746yfnx4wnfxtp8jqxwe", BlsPublicKey: "ca86e551ee42adaaa6477322d7db869d3e203c00d7b86c82ebee629ad79cb6d57b8f3db28336778ec2180e56a8e07296"}, {Index: " 9 ", Address: "one1p7ht2d4kl8ve7a8jxw746yfnx4wnfxtp8jqxwe", BLSPublicKey: "ca86e551ee42adaaa6477322d7db869d3e203c00d7b86c82ebee629ad79cb6d57b8f3db28336778ec2180e56a8e07296"},
} }

@ -2,14 +2,14 @@ package genesis
// NewNodeAccounts are the accounts for the new node // NewNodeAccounts are the accounts for the new node
var NewNodeAccounts = [...]DeployAccount{ var NewNodeAccounts = [...]DeployAccount{
{Index: "0", Address: "one1pevmwe74uax00v57lxlv8kjvgqkn2lrv843nt9", BlsPublicKey: "92fa832056e71ea833e24a7e877e2f371ca645cf338a4cb93c2ced40d8d6676eaf15dac642f22c238d58fed279f34700"}, {Index: "0", Address: "one1pevmwe74uax00v57lxlv8kjvgqkn2lrv843nt9", BLSPublicKey: "92fa832056e71ea833e24a7e877e2f371ca645cf338a4cb93c2ced40d8d6676eaf15dac642f22c238d58fed279f34700"},
{Index: "1", Address: "one1p74d4qwzq0r5etrcv7r004pggaaqf0uu273jdl", BlsPublicKey: "d1ac9bbf790e347cbe5e6fb9145f5ffd93e335452f94829df6376c6924fbceea4b96ac8c29778e7b06a92e25bd06f892"}, {Index: "1", Address: "one1p74d4qwzq0r5etrcv7r004pggaaqf0uu273jdl", BLSPublicKey: "d1ac9bbf790e347cbe5e6fb9145f5ffd93e335452f94829df6376c6924fbceea4b96ac8c29778e7b06a92e25bd06f892"},
{Index: "2", Address: "one1plfz300maxksezvwng87utn0kq04jmcd4jx4c8", BlsPublicKey: "0a4d8c3168072ac82604103b3ca5efd038ae38c6062f303b08a24152b8c58d1ff3b578521f80a386bcfa2ad6c680ba14"}, {Index: "2", Address: "one1plfz300maxksezvwng87utn0kq04jmcd4jx4c8", BLSPublicKey: "0a4d8c3168072ac82604103b3ca5efd038ae38c6062f303b08a24152b8c58d1ff3b578521f80a386bcfa2ad6c680ba14"},
{Index: "3", Address: "one1zgllsvfn8cnx95qvvz3vgmm3jcsy2phf4wj7hm", BlsPublicKey: "a31b122157b1d6d958a184361299396b3b72a3cdcd20eb5e07e18bc03034fa1a8ddbd2e0f9e3ed68cd412b7b673c0094"}, {Index: "3", Address: "one1zgllsvfn8cnx95qvvz3vgmm3jcsy2phf4wj7hm", BLSPublicKey: "a31b122157b1d6d958a184361299396b3b72a3cdcd20eb5e07e18bc03034fa1a8ddbd2e0f9e3ed68cd412b7b673c0094"},
{Index: "4", Address: "one1zfq8w55g6rhfw4vr52nsygqx2ww6mv658l4r5y", BlsPublicKey: "1aeaebce1a8a8aabb64877491a392f63682b3e2a223d1d3c7c5ef8d5b33e5e700543d5c9d8017c8520e6d7193f496f05"}, {Index: "4", Address: "one1zfq8w55g6rhfw4vr52nsygqx2ww6mv658l4r5y", BLSPublicKey: "1aeaebce1a8a8aabb64877491a392f63682b3e2a223d1d3c7c5ef8d5b33e5e700543d5c9d8017c8520e6d7193f496f05"},
{Index: "5", Address: "one1zfacedclk7pn3k00lermk5wzatfej5mct4hh5r", BlsPublicKey: "3ec3dd79bd1a8e27d0fa927bbf0f425ce564a962389a723924f071fc7802bc5924d848980595cd584e3588a6d3e0a191"}, {Index: "5", Address: "one1zfacedclk7pn3k00lermk5wzatfej5mct4hh5r", BLSPublicKey: "3ec3dd79bd1a8e27d0fa927bbf0f425ce564a962389a723924f071fc7802bc5924d848980595cd584e3588a6d3e0a191"},
{Index: "6", Address: "one1zsdsurc9wwdhk7zx2n5h86dez3j8824ef59clr", BlsPublicKey: "f2f085fb9258e47601db4c3b87f9d603b7557b57e1c4e0361f86f42070b45bca09d69276c4717846589b3a99481eed80"}, {Index: "6", Address: "one1zsdsurc9wwdhk7zx2n5h86dez3j8824ef59clr", BLSPublicKey: "f2f085fb9258e47601db4c3b87f9d603b7557b57e1c4e0361f86f42070b45bca09d69276c4717846589b3a99481eed80"},
{Index: "7", Address: "one1zjfwh58vl42tfss3kd7g3yd6xjfu2ggqsg2ecs", BlsPublicKey: "01c91a20ec490e2e6663a3c5ce04e57b991998f8967453535360de66e14dca797aa5fd270cc6d3dbc31d684d2622af05"}, {Index: "7", Address: "one1zjfwh58vl42tfss3kd7g3yd6xjfu2ggqsg2ecs", BLSPublicKey: "01c91a20ec490e2e6663a3c5ce04e57b991998f8967453535360de66e14dca797aa5fd270cc6d3dbc31d684d2622af05"},
{Index: "8", Address: "one1z5c2q3vjl8pm7p4vvpz9yhcgjdld8rkmu9uwdh", BlsPublicKey: "fe3f52d068bb83211b3e804a29f27699f9388d2dd0fcbf91353e4dd68da69636046a24fd5912f8dd5e97388577fd388a"}, {Index: "8", Address: "one1z5c2q3vjl8pm7p4vvpz9yhcgjdld8rkmu9uwdh", BLSPublicKey: "fe3f52d068bb83211b3e804a29f27699f9388d2dd0fcbf91353e4dd68da69636046a24fd5912f8dd5e97388577fd388a"},
{Index: "9", Address: "one1u24h3m8ny5yyfpv40vjen4fme72ye09gn5mr9q", BlsPublicKey: "c02e49e1395c6fbbabf0d619d872f74774d34ddec83553cf7f687da593253d072d5d050b3b4a3005304e504781847999"}, {Index: "9", Address: "one1u24h3m8ny5yyfpv40vjen4fme72ye09gn5mr9q", BLSPublicKey: "c02e49e1395c6fbbabf0d619d872f74774d34ddec83553cf7f687da593253d072d5d050b3b4a3005304e504781847999"},
} }

@ -2,84 +2,84 @@ package genesis
// PangaeaAccounts are the accounts for the Pangaea nodes // PangaeaAccounts are the accounts for the Pangaea nodes
var PangaeaAccounts = []DeployAccount{ var PangaeaAccounts = []DeployAccount{
{Index: "0", Address: "one10m6luat8phj6msqpzmg3us8evvyycsfa0cl70w", BlsPublicKey: "52167fc8450eb655ea1fb3de45ec7694fb3afea6778f6b4c46beb0ba9d4137334cd4b625e2f09bd55c37d72ba8697816"}, {Index: "0", Address: "one10m6luat8phj6msqpzmg3us8evvyycsfa0cl70w", BLSPublicKey: "52167fc8450eb655ea1fb3de45ec7694fb3afea6778f6b4c46beb0ba9d4137334cd4b625e2f09bd55c37d72ba8697816"},
{Index: "1", Address: "one12663d6yxj9j6cnztgxhmatw6ckatleysum6l6e", BlsPublicKey: "aaa5140673b55c290f6a24daae31cf03e5df803e439fb0f62b282d380b67d34f2db44f2117841f43c113c885bec51189"}, {Index: "1", Address: "one12663d6yxj9j6cnztgxhmatw6ckatleysum6l6e", BLSPublicKey: "aaa5140673b55c290f6a24daae31cf03e5df803e439fb0f62b282d380b67d34f2db44f2117841f43c113c885bec51189"},
{Index: "2", Address: "one1303a4kjgj0ykscxynkgefv5yu830349c45ur9q", BlsPublicKey: "9ad18902d96f9731da2b61e415132705dee363057f70ce70dc64ded7de18ee16e9fcbdd83bd4c89acc262c6113081704"}, {Index: "2", Address: "one1303a4kjgj0ykscxynkgefv5yu830349c45ur9q", BLSPublicKey: "9ad18902d96f9731da2b61e415132705dee363057f70ce70dc64ded7de18ee16e9fcbdd83bd4c89acc262c6113081704"},
{Index: "3", Address: "one1346cwypec0lcy3an4mgxtp80lj6vtv2kukv006", BlsPublicKey: "48b5cbe351a14abeddf3b296636cc2ded33c1e2ab47bdad3f5a584790d35cba54cb0b0da28178f379728aa4d23974982"}, {Index: "3", Address: "one1346cwypec0lcy3an4mgxtp80lj6vtv2kukv006", BLSPublicKey: "48b5cbe351a14abeddf3b296636cc2ded33c1e2ab47bdad3f5a584790d35cba54cb0b0da28178f379728aa4d23974982"},
{Index: "4", Address: "one13a7uq2vj6fncqz56pxjx4j27hywvhf948s8qz8", BlsPublicKey: "e5d325e3276eddb60e946a497e7590c355c89045a94dd2a2f02fb00440ac8075246bd0e7e8e0600406feaab26217df03"}, {Index: "4", Address: "one13a7uq2vj6fncqz56pxjx4j27hywvhf948s8qz8", BLSPublicKey: "e5d325e3276eddb60e946a497e7590c355c89045a94dd2a2f02fb00440ac8075246bd0e7e8e0600406feaab26217df03"},
{Index: "5", Address: "one13pjadjmmdlntjt5lyvfguh4l56rtr4z9q6js48", BlsPublicKey: "564d17203503c4dc00838cf8f29f4c1e74f287ba635b9d0c027cd35a57c9ced8588c8318719b92876ea19ef8b2baeb01"}, {Index: "5", Address: "one13pjadjmmdlntjt5lyvfguh4l56rtr4z9q6js48", BLSPublicKey: "564d17203503c4dc00838cf8f29f4c1e74f287ba635b9d0c027cd35a57c9ced8588c8318719b92876ea19ef8b2baeb01"},
{Index: "6", Address: "one149a4ud77z369dyz3grhty30kwtwcv0r7649hdf", BlsPublicKey: "916182f1133407525ff154b89e2ad5d7d2347c5f678b1e0cfa18272320550bf774a32e83feda6c296d27e52e71004090"}, {Index: "6", Address: "one149a4ud77z369dyz3grhty30kwtwcv0r7649hdf", BLSPublicKey: "916182f1133407525ff154b89e2ad5d7d2347c5f678b1e0cfa18272320550bf774a32e83feda6c296d27e52e71004090"},
{Index: "7", Address: "one15hxzm8k6a9m0yu44rwmpwxe9emvx3zjj2vazn2", BlsPublicKey: "4122b836daeb965f53e82ee614d2215a8f8b0b8346a0c3ffa45233ed1b57fae54a5ef499d0a0ca74f6d88fa021b3dd0f"}, {Index: "7", Address: "one15hxzm8k6a9m0yu44rwmpwxe9emvx3zjj2vazn2", BLSPublicKey: "4122b836daeb965f53e82ee614d2215a8f8b0b8346a0c3ffa45233ed1b57fae54a5ef499d0a0ca74f6d88fa021b3dd0f"},
{Index: "8", Address: "one15y925pwq98asr2pwkpq0uhquzskwcj4h208xxk", BlsPublicKey: "65de4c366a11a5153b8cc0acd2020e167548d5acfc8df7f9ff50789b871718c35eaf688ef296ca2dfcf0f4ec68f6898e"}, {Index: "8", Address: "one15y925pwq98asr2pwkpq0uhquzskwcj4h208xxk", BLSPublicKey: "65de4c366a11a5153b8cc0acd2020e167548d5acfc8df7f9ff50789b871718c35eaf688ef296ca2dfcf0f4ec68f6898e"},
{Index: "9", Address: "one16a2sey9eys6yg3rwnnphzwauj8rcgws37kxfut", BlsPublicKey: "e76f85ddf81ea2f607aaf9bf7ed50c83f89c9bf2986f79b2df1388dae794bffea98ef25431c6e5a60996c2bf84272611"}, {Index: "9", Address: "one16a2sey9eys6yg3rwnnphzwauj8rcgws37kxfut", BLSPublicKey: "e76f85ddf81ea2f607aaf9bf7ed50c83f89c9bf2986f79b2df1388dae794bffea98ef25431c6e5a60996c2bf84272611"},
{Index: "10", Address: "one16gc5f838tz3vr6fe7cck2ruh3w2q0takmmzeea", BlsPublicKey: "e90ce6f7432abe80a6e4880c9bdf8374526c405096a2471966e73a6ceedb3e288dde94b73e6c8f70fdcfda001adecf14"}, {Index: "10", Address: "one16gc5f838tz3vr6fe7cck2ruh3w2q0takmmzeea", BLSPublicKey: "e90ce6f7432abe80a6e4880c9bdf8374526c405096a2471966e73a6ceedb3e288dde94b73e6c8f70fdcfda001adecf14"},
{Index: "11", Address: "one16r4umvc9d3ghuk0nrg6lgvtpqeat58caqylvs9", BlsPublicKey: "73b2c4e8a485f5e9bc5b351f9c34f1619845ddf5502f05d55e88caa20cbf2f272880ee60870a0e3088ff1e00b0f0ae18"}, {Index: "11", Address: "one16r4umvc9d3ghuk0nrg6lgvtpqeat58caqylvs9", BLSPublicKey: "73b2c4e8a485f5e9bc5b351f9c34f1619845ddf5502f05d55e88caa20cbf2f272880ee60870a0e3088ff1e00b0f0ae18"},
{Index: "12", Address: "one1784gdt8wftsy63vcfxu6p80exrmclk6pncyjqq", BlsPublicKey: "d3315aac34e1de513f4566d1cc27bc79c77436982d32fbac0e70f8f0b253439c9304cf88e9739ce5397b7bb15aa59380"}, {Index: "12", Address: "one1784gdt8wftsy63vcfxu6p80exrmclk6pncyjqq", BLSPublicKey: "d3315aac34e1de513f4566d1cc27bc79c77436982d32fbac0e70f8f0b253439c9304cf88e9739ce5397b7bb15aa59380"},
{Index: "13", Address: "one17juh9a2js0nfz8676quzz95mv55khsrx7nl38u", BlsPublicKey: "d1b94ca8aae2cee7f270b20935c1120bccbb8309f9647c5dfa3389f82c24466f313b1b325b60a77ea70cbd0ef19ccb0c"}, {Index: "13", Address: "one17juh9a2js0nfz8676quzz95mv55khsrx7nl38u", BLSPublicKey: "d1b94ca8aae2cee7f270b20935c1120bccbb8309f9647c5dfa3389f82c24466f313b1b325b60a77ea70cbd0ef19ccb0c"},
{Index: "14", Address: "one17ss4sdncwnrpqrq0km3hx2y7cg36jf9aalhq5j", BlsPublicKey: "262937a340f1bb2ceb8beaf90654524a5d5afe77f61507f6b7993becf54592be3d96610a4ef41735b928fa88788ec295"}, {Index: "14", Address: "one17ss4sdncwnrpqrq0km3hx2y7cg36jf9aalhq5j", BLSPublicKey: "262937a340f1bb2ceb8beaf90654524a5d5afe77f61507f6b7993becf54592be3d96610a4ef41735b928fa88788ec295"},
{Index: "15", Address: "one1950ylfk989sf54zqnrxv0zm4mdtyl4v257vljy", BlsPublicKey: "d47199047751f2366480394a30fd7f81a3a49e3d5ef902cb2dc309f26dbe46028dbcececb2bbf0cfb89d36df0153dc12"}, {Index: "15", Address: "one1950ylfk989sf54zqnrxv0zm4mdtyl4v257vljy", BLSPublicKey: "d47199047751f2366480394a30fd7f81a3a49e3d5ef902cb2dc309f26dbe46028dbcececb2bbf0cfb89d36df0153dc12"},
{Index: "16", Address: "one197dczvza762zwapyhm8ze0y6tkdhq6434lgwr8", BlsPublicKey: "62dffae97915f4634318b43383301cc3f32409b10706d1639192b3915bafd32e4ca28ba5b05fb669197eb5b5a562e385"}, {Index: "16", Address: "one197dczvza762zwapyhm8ze0y6tkdhq6434lgwr8", BLSPublicKey: "62dffae97915f4634318b43383301cc3f32409b10706d1639192b3915bafd32e4ca28ba5b05fb669197eb5b5a562e385"},
{Index: "17", Address: "one19rv5lwwrqggk0pt6gppvyhpmpxtu7m6h6mvpj9", BlsPublicKey: "1dab2354e1365855d6caf072a90bd1adfd25a769acde7085235d05c98b595d1f987089db551735c97c586b044c7bf50e"}, {Index: "17", Address: "one19rv5lwwrqggk0pt6gppvyhpmpxtu7m6h6mvpj9", BLSPublicKey: "1dab2354e1365855d6caf072a90bd1adfd25a769acde7085235d05c98b595d1f987089db551735c97c586b044c7bf50e"},
{Index: "18", Address: "one19udhzxdzvzy60yrexsymsxf60h690lc8rerxl7", BlsPublicKey: "4d91334a74c9be1f867c1740a2170e7a12bd80d9580982f621feab2aef561044b7d3b1327ec5b177ee24f9861e435400"}, {Index: "18", Address: "one19udhzxdzvzy60yrexsymsxf60h690lc8rerxl7", BLSPublicKey: "4d91334a74c9be1f867c1740a2170e7a12bd80d9580982f621feab2aef561044b7d3b1327ec5b177ee24f9861e435400"},
{Index: "19", Address: "one19zjh4vdkec03dn5aunhca7yylaun62ntvqh3gl", BlsPublicKey: "3b15acc11694aa09aafff543cd53f74feda4de696169b0bfc3690ca584607ebc75fae210a09e9c427c76227840ae9385"}, {Index: "19", Address: "one19zjh4vdkec03dn5aunhca7yylaun62ntvqh3gl", BLSPublicKey: "3b15acc11694aa09aafff543cd53f74feda4de696169b0bfc3690ca584607ebc75fae210a09e9c427c76227840ae9385"},
{Index: "20", Address: "one1a6kepv0aw4na55ue9vn0nnl6dfcpr77a4jwne7", BlsPublicKey: "7edd9431537c192a830e45143b6b83a8338e5ecd89d10c26af4acdc0d0a1f6a0d45a3992e36e3cd01fd26b8659144213"}, {Index: "20", Address: "one1a6kepv0aw4na55ue9vn0nnl6dfcpr77a4jwne7", BLSPublicKey: "7edd9431537c192a830e45143b6b83a8338e5ecd89d10c26af4acdc0d0a1f6a0d45a3992e36e3cd01fd26b8659144213"},
{Index: "21", Address: "one1a9fcp0ntp0tzaj5ve4yf8ejz9gx7gcgc4c0ls0", BlsPublicKey: "c64e21a877d96d50730791ab490196733a2da212a2cb34db48f162348453dd400f5ac6cf834c838d44f9eab48a7f8194"}, {Index: "21", Address: "one1a9fcp0ntp0tzaj5ve4yf8ejz9gx7gcgc4c0ls0", BLSPublicKey: "c64e21a877d96d50730791ab490196733a2da212a2cb34db48f162348453dd400f5ac6cf834c838d44f9eab48a7f8194"},
{Index: "22", Address: "one1aayq3n28er7devjdxfc5aaf9vp07fww2wmvj9n", BlsPublicKey: "07d56ce064cb571b45efb1b5f36dd74775ec0599583816531669bbb12c4cd1ff92b35450cce6de48d3cdb3b9918cdb92"}, {Index: "22", Address: "one1aayq3n28er7devjdxfc5aaf9vp07fww2wmvj9n", BLSPublicKey: "07d56ce064cb571b45efb1b5f36dd74775ec0599583816531669bbb12c4cd1ff92b35450cce6de48d3cdb3b9918cdb92"},
{Index: "23", Address: "one1anztxuvyvudff2lllzejslg5lnqyeulg6ux30t", BlsPublicKey: "23bcc63df1be3568a19d979e7908c2e823bdfae09e72c19329f83c93fbc6b18a8426df5319b27a028012420f4fe61308"}, {Index: "23", Address: "one1anztxuvyvudff2lllzejslg5lnqyeulg6ux30t", BLSPublicKey: "23bcc63df1be3568a19d979e7908c2e823bdfae09e72c19329f83c93fbc6b18a8426df5319b27a028012420f4fe61308"},
{Index: "24", Address: "one1crae65pm7pmcpvfpqfs0vf60wck2qtw3ymcsgl", BlsPublicKey: "b54d4c6ffc2c20555dd435380b46f1836fd1a407113959469ee11909d9ffc8f88654494990643566ab8d5e8b2c3a3a90"}, {Index: "24", Address: "one1crae65pm7pmcpvfpqfs0vf60wck2qtw3ymcsgl", BLSPublicKey: "b54d4c6ffc2c20555dd435380b46f1836fd1a407113959469ee11909d9ffc8f88654494990643566ab8d5e8b2c3a3a90"},
{Index: "25", Address: "one1cug2jkqrwwtpsndks0dktlnwkwvmxumgrz566t", BlsPublicKey: "855bf274bad4ac5f1018e394152fc2e2c68051f69621c19aaca580fe4452ae6c762988c042bd38f8d46d1eb020ca9884"}, {Index: "25", Address: "one1cug2jkqrwwtpsndks0dktlnwkwvmxumgrz566t", BLSPublicKey: "855bf274bad4ac5f1018e394152fc2e2c68051f69621c19aaca580fe4452ae6c762988c042bd38f8d46d1eb020ca9884"},
{Index: "26", Address: "one1d5y09kyp4fw2f784j9wkeld3a75t52ctwm0xvp", BlsPublicKey: "75ab0ad7a07c555124e1edae1386d1647f3c8609f9c1c64c26c41d51769248944206619e0239e697bce1f74a37140781"}, {Index: "26", Address: "one1d5y09kyp4fw2f784j9wkeld3a75t52ctwm0xvp", BLSPublicKey: "75ab0ad7a07c555124e1edae1386d1647f3c8609f9c1c64c26c41d51769248944206619e0239e697bce1f74a37140781"},
{Index: "27", Address: "one1eupllhyyjqgyt7nflxrktvv2nqt6vys7hxul5p", BlsPublicKey: "749f60f5a49ee449cc17b3d91f2aff1e3a4becf20caaea2dea15df9dca6b5d9717a1bc4c682bea5b6e0e76050da8670e"}, {Index: "27", Address: "one1eupllhyyjqgyt7nflxrktvv2nqt6vys7hxul5p", BLSPublicKey: "749f60f5a49ee449cc17b3d91f2aff1e3a4becf20caaea2dea15df9dca6b5d9717a1bc4c682bea5b6e0e76050da8670e"},
{Index: "28", Address: "one1f48w2ar6rvf03qcl8grse5x4yj3a0pdgvnr57g", BlsPublicKey: "d04e2b46838ce0e66a0a60dcb8444c61a0980011ebce011b049a8c3f1213aae05b9d124cb07a2fbd5c0863dc8873a00f"}, {Index: "28", Address: "one1f48w2ar6rvf03qcl8grse5x4yj3a0pdgvnr57g", BLSPublicKey: "d04e2b46838ce0e66a0a60dcb8444c61a0980011ebce011b049a8c3f1213aae05b9d124cb07a2fbd5c0863dc8873a00f"},
{Index: "29", Address: "one1g3xcl0gwulkcztqxq46rsgpeswfg9979u2edvu", BlsPublicKey: "121c476760fcbab0ea08b8ff43c5d81b97e857f88e0ef4c05258dc54967690e8b21342aba4e8766ba56d11df25ff6185"}, {Index: "29", Address: "one1g3xcl0gwulkcztqxq46rsgpeswfg9979u2edvu", BLSPublicKey: "121c476760fcbab0ea08b8ff43c5d81b97e857f88e0ef4c05258dc54967690e8b21342aba4e8766ba56d11df25ff6185"},
{Index: "30", Address: "one1gd8dq7vkzuf4gyp6frk5wf3dqfs5cfx3hwq69r", BlsPublicKey: "17e6267c5b767ed490e453e2ccfe91d82901bf68a516e05a4913579b1b968d4f0d3f0af456dbc74eaa7dcb0db8994095"}, {Index: "30", Address: "one1gd8dq7vkzuf4gyp6frk5wf3dqfs5cfx3hwq69r", BLSPublicKey: "17e6267c5b767ed490e453e2ccfe91d82901bf68a516e05a4913579b1b968d4f0d3f0af456dbc74eaa7dcb0db8994095"},
{Index: "31", Address: "one1ggpskjjtgm67vmc6p7wf8l3cftq0s3karjfmqa", BlsPublicKey: "69d89878c8cb11ec3e320d9b3d8831b3b7ae79d2793a5b1fc9ba9a4eeef2720f5907abd6e2af2a7b4e9439fa4da3a999"}, {Index: "31", Address: "one1ggpskjjtgm67vmc6p7wf8l3cftq0s3karjfmqa", BLSPublicKey: "69d89878c8cb11ec3e320d9b3d8831b3b7ae79d2793a5b1fc9ba9a4eeef2720f5907abd6e2af2a7b4e9439fa4da3a999"},
{Index: "32", Address: "one1gwsnam6jfnz2twfw85lf8apu3l0wv3eguw9tr8", BlsPublicKey: "4686f5ce78fe896aa65e64257bc31d0429226d5445e8d18ca5529cf20ad30c37132c8166c5e89b9daaee6db5e4ca3203"}, {Index: "32", Address: "one1gwsnam6jfnz2twfw85lf8apu3l0wv3eguw9tr8", BLSPublicKey: "4686f5ce78fe896aa65e64257bc31d0429226d5445e8d18ca5529cf20ad30c37132c8166c5e89b9daaee6db5e4ca3203"},
{Index: "33", Address: "one1hj0a0urnmf9evx7m89txv59fdfpft3s0nwunfn", BlsPublicKey: "191b4b2c25f292ad4c482231fdac774060f44175849190f44b38ae2b41f185b5ff43ece391b8ab2a6e1949c07583eb80"}, {Index: "33", Address: "one1hj0a0urnmf9evx7m89txv59fdfpft3s0nwunfn", BLSPublicKey: "191b4b2c25f292ad4c482231fdac774060f44175849190f44b38ae2b41f185b5ff43ece391b8ab2a6e1949c07583eb80"},
{Index: "34", Address: "one1hk8hpkz2dy6gwhpza2z83xvz28qvdec5hj0r7r", BlsPublicKey: "1449c5f832ba027ad0cc0493400d2671df313509002bdeb2a23d128ddb839857f0968a11fff41b727e884afade70a78a"}, {Index: "34", Address: "one1hk8hpkz2dy6gwhpza2z83xvz28qvdec5hj0r7r", BLSPublicKey: "1449c5f832ba027ad0cc0493400d2671df313509002bdeb2a23d128ddb839857f0968a11fff41b727e884afade70a78a"},
{Index: "35", Address: "one1hqjvg2756skfncekre63zr24hv67p8gcf8j5zq", BlsPublicKey: "1fe726339bbc00269c3a7638eb68f4b6fab1f79c81dd347f64c3fd8cb9b39d25bd2aa8ec066b4f2ca59cf3d159bc9e94"}, {Index: "35", Address: "one1hqjvg2756skfncekre63zr24hv67p8gcf8j5zq", BLSPublicKey: "1fe726339bbc00269c3a7638eb68f4b6fab1f79c81dd347f64c3fd8cb9b39d25bd2aa8ec066b4f2ca59cf3d159bc9e94"},
{Index: "36", Address: "one1htvj9weuzy99vgcekk7j9839ekq9nlp7xh5826", BlsPublicKey: "66002b3b505b6ea30e9f60b7881c8b79ad5e6eb12bf83bd4a2124bb2e0255268508f9437d3f50494504f4b0c1795ee06"}, {Index: "36", Address: "one1htvj9weuzy99vgcekk7j9839ekq9nlp7xh5826", BLSPublicKey: "66002b3b505b6ea30e9f60b7881c8b79ad5e6eb12bf83bd4a2124bb2e0255268508f9437d3f50494504f4b0c1795ee06"},
{Index: "37", Address: "one1hvcjyssnvfvvln002t5g6vsjxpqlfw0xmxr3tg", BlsPublicKey: "fd670e959a6cdbfe59332a9356f03d0dd77d4377861270b56c26bf6d1c5535e90b00aeef8875652d5b2e9527b78b4d81"}, {Index: "37", Address: "one1hvcjyssnvfvvln002t5g6vsjxpqlfw0xmxr3tg", BLSPublicKey: "fd670e959a6cdbfe59332a9356f03d0dd77d4377861270b56c26bf6d1c5535e90b00aeef8875652d5b2e9527b78b4d81"},
{Index: "38", Address: "one1hxl6j46c7nezmrxe0jwmhurst56zl7sqp6jycv", BlsPublicKey: "d270b17a2428c6900e09e4fccd3fe30cb3c560bef5195f4d67b8c8df041847c3801c8ae974002681a5b18a04da7b978c"}, {Index: "38", Address: "one1hxl6j46c7nezmrxe0jwmhurst56zl7sqp6jycv", BLSPublicKey: "d270b17a2428c6900e09e4fccd3fe30cb3c560bef5195f4d67b8c8df041847c3801c8ae974002681a5b18a04da7b978c"},
{Index: "39", Address: "one1j2usclf3q8xxz728dfee90lycwlyu68q33fsn5", BlsPublicKey: "842451513775c9132d9543335a8e2d98024e34811d97df2899cefea0e7ddcdf2ee57fae422de953755217904627bc410"}, {Index: "39", Address: "one1j2usclf3q8xxz728dfee90lycwlyu68q33fsn5", BLSPublicKey: "842451513775c9132d9543335a8e2d98024e34811d97df2899cefea0e7ddcdf2ee57fae422de953755217904627bc410"},
{Index: "40", Address: "one1j9lycwpx2lp956jnkwav4s88c5mehqn39alak0", BlsPublicKey: "8b8134193c165e4eef967eebdb614ef30a1b7fef8c40e4c2812972fc3540bbc4b387be4ab12c9b53b0e5bbad48c6fc0c"}, {Index: "40", Address: "one1j9lycwpx2lp956jnkwav4s88c5mehqn39alak0", BLSPublicKey: "8b8134193c165e4eef967eebdb614ef30a1b7fef8c40e4c2812972fc3540bbc4b387be4ab12c9b53b0e5bbad48c6fc0c"},
{Index: "41", Address: "one1jgufmuleldnsptgpkplww422d62fjl9gnnfjcv", BlsPublicKey: "2daf344d3895447cd499ec44c587bdde1ee2846ec7577f2de2328026babb7e3efa4465f7449abb71254cbbe9ab002b11"}, {Index: "41", Address: "one1jgufmuleldnsptgpkplww422d62fjl9gnnfjcv", BLSPublicKey: "2daf344d3895447cd499ec44c587bdde1ee2846ec7577f2de2328026babb7e3efa4465f7449abb71254cbbe9ab002b11"},
{Index: "42", Address: "one1jye0rayd5dgwsrlpjh5mdtvw7u0vuuvl6g550y", BlsPublicKey: "a6007a4f1dffb3126d3897fb33f105dd1dd85e193730b2fbe04874627e78af03f985a58ba10a63fd7e05b0efa41bae88"}, {Index: "42", Address: "one1jye0rayd5dgwsrlpjh5mdtvw7u0vuuvl6g550y", BLSPublicKey: "a6007a4f1dffb3126d3897fb33f105dd1dd85e193730b2fbe04874627e78af03f985a58ba10a63fd7e05b0efa41bae88"},
{Index: "43", Address: "one1kl3z97c6x7n46734wghtk6hwf0v6jn6fl47xhj", BlsPublicKey: "2b3d8fbbdd4dbe0752f41f5cae1a7bdb17590e00dac5ccb398327f332adfabc333ade41c780c37fa29f342df093e150c"}, {Index: "43", Address: "one1kl3z97c6x7n46734wghtk6hwf0v6jn6fl47xhj", BLSPublicKey: "2b3d8fbbdd4dbe0752f41f5cae1a7bdb17590e00dac5ccb398327f332adfabc333ade41c780c37fa29f342df093e150c"},
{Index: "44", Address: "one1lng4jxrxje9j5zg6j3gqdkachpnrgx58h42vpf", BlsPublicKey: "9310ad772cd318aaafdbb714695e78207c7feac1b65c4dd47c64bca1388a97dbb1b6d35dec874bdac0d69915bdb36014"}, {Index: "44", Address: "one1lng4jxrxje9j5zg6j3gqdkachpnrgx58h42vpf", BLSPublicKey: "9310ad772cd318aaafdbb714695e78207c7feac1b65c4dd47c64bca1388a97dbb1b6d35dec874bdac0d69915bdb36014"},
{Index: "45", Address: "one1lqg2eqmujt7mml78adqm3eqpeucm5vmvac8nkm", BlsPublicKey: "ce12b453f08b108e3f3cfd4eaead0cb00f1a9912c3f3a5dee144fa3950be16b8cfb6fc71c0d228256f9e384636cf8684"}, {Index: "45", Address: "one1lqg2eqmujt7mml78adqm3eqpeucm5vmvac8nkm", BLSPublicKey: "ce12b453f08b108e3f3cfd4eaead0cb00f1a9912c3f3a5dee144fa3950be16b8cfb6fc71c0d228256f9e384636cf8684"},
{Index: "46", Address: "one1ls66srcg88hdr4z4zudte8tg3gdfqn954y790a", BlsPublicKey: "9d65e76ff3dffd57af7cb50e7093f3db77778c6ae81e841eadf30abd4bdeb69c77eead1640a9a80892701b73a9caa898"}, {Index: "46", Address: "one1ls66srcg88hdr4z4zudte8tg3gdfqn954y790a", BLSPublicKey: "9d65e76ff3dffd57af7cb50e7093f3db77778c6ae81e841eadf30abd4bdeb69c77eead1640a9a80892701b73a9caa898"},
{Index: "47", Address: "one1m3jkq8d7223lumgmrspn0yvfgq8w6jtsvql96y", BlsPublicKey: "0e39bb1850cbb1d9cfc178089f4022fb225042b060767975f3bb145604087c8f23f8c42c0e29c470519ab2daa21d9392"}, {Index: "47", Address: "one1m3jkq8d7223lumgmrspn0yvfgq8w6jtsvql96y", BLSPublicKey: "0e39bb1850cbb1d9cfc178089f4022fb225042b060767975f3bb145604087c8f23f8c42c0e29c470519ab2daa21d9392"},
{Index: "48", Address: "one1mdl6t3yhvqh7c30g9gtsns884hep9wya02mzaa", BlsPublicKey: "a03b9e88fc06c11b9720a2517a04b92ea3fab3306b8b2aa6d21b8b75a5bcfd5b00bcdb532163ada8493e6e163d83720b"}, {Index: "48", Address: "one1mdl6t3yhvqh7c30g9gtsns884hep9wya02mzaa", BLSPublicKey: "a03b9e88fc06c11b9720a2517a04b92ea3fab3306b8b2aa6d21b8b75a5bcfd5b00bcdb532163ada8493e6e163d83720b"},
{Index: "49", Address: "one1pdkrj2v5na0ec6uufhjmrdjau4jflwh0myp9rv", BlsPublicKey: "ded653e037769fc784979a730a665fe9d2932ff015b6a95196fa674eed8ec63dbd909f18dfdd610d8eb4526e7b1e3000"}, {Index: "49", Address: "one1pdkrj2v5na0ec6uufhjmrdjau4jflwh0myp9rv", BLSPublicKey: "ded653e037769fc784979a730a665fe9d2932ff015b6a95196fa674eed8ec63dbd909f18dfdd610d8eb4526e7b1e3000"},
{Index: "50", Address: "one1pxr2n6tnvadajr6g0lkwe0e5wnvfcg9wpkezc5", BlsPublicKey: "09112aa711ae8e7ae15e5e689a812e2f8d0129a023a613d100019f7e339a766e3f826d5f4f2869f44a84745d39574205"}, {Index: "50", Address: "one1pxr2n6tnvadajr6g0lkwe0e5wnvfcg9wpkezc5", BLSPublicKey: "09112aa711ae8e7ae15e5e689a812e2f8d0129a023a613d100019f7e339a766e3f826d5f4f2869f44a84745d39574205"},
{Index: "51", Address: "one1q7nk7rzmcyh60x2mc3s6arcx5qtwd5cw5tff33", BlsPublicKey: "0be986e8851edd23943310d6a403915458ab2c90ce23272e24d7a694822a6ffb760b9744104aef3984c947e47dfef513"}, {Index: "51", Address: "one1q7nk7rzmcyh60x2mc3s6arcx5qtwd5cw5tff33", BLSPublicKey: "0be986e8851edd23943310d6a403915458ab2c90ce23272e24d7a694822a6ffb760b9744104aef3984c947e47dfef513"},
{Index: "52", Address: "one1qdy6ek32gj4vadfflqt5hsg3klxa94chvm4tcy", BlsPublicKey: "1864fc6119ef64ec6fa8992b3de41cb787bbf6c4d4d37c04645d5a80942956a3abd387d9e8938d58c33cca3c384f3780"}, {Index: "52", Address: "one1qdy6ek32gj4vadfflqt5hsg3klxa94chvm4tcy", BLSPublicKey: "1864fc6119ef64ec6fa8992b3de41cb787bbf6c4d4d37c04645d5a80942956a3abd387d9e8938d58c33cca3c384f3780"},
{Index: "53", Address: "one1r753hfcaqj7acxjpwmqsp4s7yg7nsuu723dtps", BlsPublicKey: "e6d7bc00452e96342b7343f8a3612dbcbde488ffd3237d8de9d14624dd665bc516b9c85e555b17abb18a4ab5b5595505"}, {Index: "53", Address: "one1r753hfcaqj7acxjpwmqsp4s7yg7nsuu723dtps", BLSPublicKey: "e6d7bc00452e96342b7343f8a3612dbcbde488ffd3237d8de9d14624dd665bc516b9c85e555b17abb18a4ab5b5595505"},
{Index: "54", Address: "one1rkf2lqmeawkfrrw8pzwvu4980r5f5n6f80y05j", BlsPublicKey: "7025bb760074279b6bf0b7e0ee7f02170e57d8b5fd2e495ad649d9cb269923345d3099d2e768c81bf84a24a7e897d794"}, {Index: "54", Address: "one1rkf2lqmeawkfrrw8pzwvu4980r5f5n6f80y05j", BLSPublicKey: "7025bb760074279b6bf0b7e0ee7f02170e57d8b5fd2e495ad649d9cb269923345d3099d2e768c81bf84a24a7e897d794"},
{Index: "55", Address: "one1rs4df8wyd0d2qcmtnl98gywl7f3ja4gy7a8qp8", BlsPublicKey: "c968eb76462bc44ffba4c3d36bf363cdba11e5afcba6a47a3b77d5e301dfd1bb5e783a2135e9c183dac9b410f1e2fd82"}, {Index: "55", Address: "one1rs4df8wyd0d2qcmtnl98gywl7f3ja4gy7a8qp8", BLSPublicKey: "c968eb76462bc44ffba4c3d36bf363cdba11e5afcba6a47a3b77d5e301dfd1bb5e783a2135e9c183dac9b410f1e2fd82"},
{Index: "56", Address: "one1s4dyr9guw5g9wrwag28l7ecnzwte9dcteflsd5", BlsPublicKey: "216ef88ec96ccc23dedcf8f3a3884f80ef775077848f43beae9491689e7caa047f65bd6d9dda42062072783ac2d40497"}, {Index: "56", Address: "one1s4dyr9guw5g9wrwag28l7ecnzwte9dcteflsd5", BLSPublicKey: "216ef88ec96ccc23dedcf8f3a3884f80ef775077848f43beae9491689e7caa047f65bd6d9dda42062072783ac2d40497"},
{Index: "57", Address: "one1seap33ek8hmcsu77qpfz6s7ck5auz3af4lkl7x", BlsPublicKey: "b42ce5041276722effda7ae91a5edd7a94e3382d190d96b185f73fa02792fbc06fab0f7cffd5dcfec1ab876667291e80"}, {Index: "57", Address: "one1seap33ek8hmcsu77qpfz6s7ck5auz3af4lkl7x", BLSPublicKey: "b42ce5041276722effda7ae91a5edd7a94e3382d190d96b185f73fa02792fbc06fab0f7cffd5dcfec1ab876667291e80"},
{Index: "58", Address: "one1sngw0w4e6av50u45hgjuv46e7z0uw8fr2jcnx5", BlsPublicKey: "a667006b873225c76ee136d531cd0cc3b04e38da654782deeb590b4d8bf865869844bb787b5eb0b7260155e505c6a60b"}, {Index: "58", Address: "one1sngw0w4e6av50u45hgjuv46e7z0uw8fr2jcnx5", BLSPublicKey: "a667006b873225c76ee136d531cd0cc3b04e38da654782deeb590b4d8bf865869844bb787b5eb0b7260155e505c6a60b"},
{Index: "59", Address: "one1t3xx65z3pnsp664lvfwn0anwru26zhw9wpsdmn", BlsPublicKey: "fd9319106ae4a28acf927cf5a4cbb8b9b66f63036b383ad82f39b3ed2c6a91b580b73019fbbe1afdb5a3bfa4003aba82"}, {Index: "59", Address: "one1t3xx65z3pnsp664lvfwn0anwru26zhw9wpsdmn", BLSPublicKey: "fd9319106ae4a28acf927cf5a4cbb8b9b66f63036b383ad82f39b3ed2c6a91b580b73019fbbe1afdb5a3bfa4003aba82"},
{Index: "60", Address: "one1t48vhmdxhaadqx0sllfe6cjpdwt36lqupkgpy8", BlsPublicKey: "552cd8097b0c4001bd49769e52a2b422944bb7f556118bc8d89c0b6c202a9e972e90b0de2568c1e4aa164567bc134193"}, {Index: "60", Address: "one1t48vhmdxhaadqx0sllfe6cjpdwt36lqupkgpy8", BLSPublicKey: "552cd8097b0c4001bd49769e52a2b422944bb7f556118bc8d89c0b6c202a9e972e90b0de2568c1e4aa164567bc134193"},
{Index: "61", Address: "one1tgzj4nc09xcveyr0qfrdc7kkqvv2smjyzntq6n", BlsPublicKey: "33028b00043c4f4ea25be10537ac2e9b553197d556af60bff5dc8574696e9d15eea365072f90f9a884a4ddb4cda2a992"}, {Index: "61", Address: "one1tgzj4nc09xcveyr0qfrdc7kkqvv2smjyzntq6n", BLSPublicKey: "33028b00043c4f4ea25be10537ac2e9b553197d556af60bff5dc8574696e9d15eea365072f90f9a884a4ddb4cda2a992"},
{Index: "62", Address: "one1tputyp9pjkvjy0hq5hfxfhu3wwwqpvw2n869jh", BlsPublicKey: "4e996e163be3603b03ae25286acc064a72cde0eee7c643e10e7c69de1232df247a3837abc6b19d8e505371cc2ed49a0c"}, {Index: "62", Address: "one1tputyp9pjkvjy0hq5hfxfhu3wwwqpvw2n869jh", BLSPublicKey: "4e996e163be3603b03ae25286acc064a72cde0eee7c643e10e7c69de1232df247a3837abc6b19d8e505371cc2ed49a0c"},
{Index: "63", Address: "one1uds4t3aq6hs5xjl630menlgrh9djr24vzrsz6j", BlsPublicKey: "11a7ae1650b630bb3507489d946dfc3a6989840c5bf12583d8cbb746267d4bf9783904773b7357aa22f4b8f5b4d85b0d"}, {Index: "63", Address: "one1uds4t3aq6hs5xjl630menlgrh9djr24vzrsz6j", BLSPublicKey: "11a7ae1650b630bb3507489d946dfc3a6989840c5bf12583d8cbb746267d4bf9783904773b7357aa22f4b8f5b4d85b0d"},
{Index: "64", Address: "one1ug8a3294nqh5yq8h85q4w6fn6jcwhzqq5zakrm", BlsPublicKey: "c6d21c3e13a5f214646d84b6969f125db675211bfc5dbab0ce6bd77f5e7a66e0cfb9b7b3ff65ce019bc11840f4d96c09"}, {Index: "64", Address: "one1ug8a3294nqh5yq8h85q4w6fn6jcwhzqq5zakrm", BLSPublicKey: "c6d21c3e13a5f214646d84b6969f125db675211bfc5dbab0ce6bd77f5e7a66e0cfb9b7b3ff65ce019bc11840f4d96c09"},
{Index: "65", Address: "one1uxqv9ldh8asjgly8v8cq5284ulungxu48l4n53", BlsPublicKey: "9c1880a2cca6c979c7544666b98d9456c03eacb86540ecd27178cb120f2b091b8e70a0827523ac2e2f7531bd260f5e89"}, {Index: "65", Address: "one1uxqv9ldh8asjgly8v8cq5284ulungxu48l4n53", BLSPublicKey: "9c1880a2cca6c979c7544666b98d9456c03eacb86540ecd27178cb120f2b091b8e70a0827523ac2e2f7531bd260f5e89"},
{Index: "66", Address: "one1v8u85h4f99xgh8ej975shwreap2m3rpue7vqj5", BlsPublicKey: "d634de831b0e936b1b3f13097338873e39c56907fab2620cb88e71a0fb3680356f245e478f1c6a62cb35b34486b52b80"}, {Index: "66", Address: "one1v8u85h4f99xgh8ej975shwreap2m3rpue7vqj5", BLSPublicKey: "d634de831b0e936b1b3f13097338873e39c56907fab2620cb88e71a0fb3680356f245e478f1c6a62cb35b34486b52b80"},
{Index: "67", Address: "one1vkwtjv43fvsq6e0nsvm6pth90cz55vuc64th3n", BlsPublicKey: "fa42f0917ab84a866f682026dc84ac2b9a5d0ea0ad8ed693618a949f24f830e61e4ed9253d3c50d5133bb415fa2eae81"}, {Index: "67", Address: "one1vkwtjv43fvsq6e0nsvm6pth90cz55vuc64th3n", BLSPublicKey: "fa42f0917ab84a866f682026dc84ac2b9a5d0ea0ad8ed693618a949f24f830e61e4ed9253d3c50d5133bb415fa2eae81"},
{Index: "68", Address: "one1w4zh2nlajum0czttaszl7wm8zuealgaungdlh0", BlsPublicKey: "7af325e13ba1c08a9468433fd34d0adb3cea2eae8d88bf5932115bf1e08e9aae0ddcde4fb840bc2af6006b42d1568a0d"}, {Index: "68", Address: "one1w4zh2nlajum0czttaszl7wm8zuealgaungdlh0", BLSPublicKey: "7af325e13ba1c08a9468433fd34d0adb3cea2eae8d88bf5932115bf1e08e9aae0ddcde4fb840bc2af6006b42d1568a0d"},
{Index: "69", Address: "one1wnj8tsgrjw0xkqgksz6wnhjzkegn8pcqny8jyk", BlsPublicKey: "9f3c6df824ceacbfb8600e82aeee67941c19043cb25275512ac36eacdddaa41c8989711ebe4a55c28f44606ceed22012"}, {Index: "69", Address: "one1wnj8tsgrjw0xkqgksz6wnhjzkegn8pcqny8jyk", BLSPublicKey: "9f3c6df824ceacbfb8600e82aeee67941c19043cb25275512ac36eacdddaa41c8989711ebe4a55c28f44606ceed22012"},
{Index: "70", Address: "one1wnyw6ca5vpsah38w8gu08mssygfz2aztdz68rr", BlsPublicKey: "c3a71f491ad60f92197e39a123bef674bd28cdffd8d26a586324407995301d17aaf39d0b3308237abc031dc799828e18"}, {Index: "70", Address: "one1wnyw6ca5vpsah38w8gu08mssygfz2aztdz68rr", BLSPublicKey: "c3a71f491ad60f92197e39a123bef674bd28cdffd8d26a586324407995301d17aaf39d0b3308237abc031dc799828e18"},
{Index: "71", Address: "one1wshg9x4y79q334wzfdcwedqheg62zdpfu8f969", BlsPublicKey: "945f894815addc54193737f4534975f20cfb11320873ab9a3aa4448740e76112e0262013f0946aef5f1724b2c8ad0792"}, {Index: "71", Address: "one1wshg9x4y79q334wzfdcwedqheg62zdpfu8f969", BLSPublicKey: "945f894815addc54193737f4534975f20cfb11320873ab9a3aa4448740e76112e0262013f0946aef5f1724b2c8ad0792"},
{Index: "72", Address: "one1xglw5uqpn5gkx05p0gsyenjh77at3l009va68h", BlsPublicKey: "3bb8c56255aff32d6ce197912022119f3823ab27e009eb4b8630d8004b98967116d0354d7c5ced181bc7693dc45b538f"}, {Index: "72", Address: "one1xglw5uqpn5gkx05p0gsyenjh77at3l009va68h", BLSPublicKey: "3bb8c56255aff32d6ce197912022119f3823ab27e009eb4b8630d8004b98967116d0354d7c5ced181bc7693dc45b538f"},
{Index: "73", Address: "one1xuhq3m6n9clfxjqwpcxhaaaz4mp3sghfnhch62", BlsPublicKey: "62cfbb92237bde0c53a0cfdcd5e65a1bf49aa660b478778598d09a33e58a383d03f76e64a276720754dbd80734bc010a"}, {Index: "73", Address: "one1xuhq3m6n9clfxjqwpcxhaaaz4mp3sghfnhch62", BLSPublicKey: "62cfbb92237bde0c53a0cfdcd5e65a1bf49aa660b478778598d09a33e58a383d03f76e64a276720754dbd80734bc010a"},
{Index: "74", Address: "one1y24qeuh7fxafljsa0a8nc0dzneygtgn5fu8mps", BlsPublicKey: "38b72cb4904a783c2b72feb3f26b8a1ed7830eba80a36ab514a7990289023ef11e01ed1ff9ea317ad5d444c45d554a16"}, {Index: "74", Address: "one1y24qeuh7fxafljsa0a8nc0dzneygtgn5fu8mps", BLSPublicKey: "38b72cb4904a783c2b72feb3f26b8a1ed7830eba80a36ab514a7990289023ef11e01ed1ff9ea317ad5d444c45d554a16"},
{Index: "75", Address: "one1y4hzjn6p8etkvkmdy8am62jeqqsmhmjm8eyxec", BlsPublicKey: "bcbca852be1f5f17e4f36ee91143c0815aa4d0089f936e0318ca509348ec81876ee1235ec76a9651a432e68a310cfa0f"}, {Index: "75", Address: "one1y4hzjn6p8etkvkmdy8am62jeqqsmhmjm8eyxec", BLSPublicKey: "bcbca852be1f5f17e4f36ee91143c0815aa4d0089f936e0318ca509348ec81876ee1235ec76a9651a432e68a310cfa0f"},
{Index: "76", Address: "one1yg605zuc6z96k074rr37cjdw63e8aa8q47rapg", BlsPublicKey: "ec33858022e0f47684da5b206f5fa3af6718be795c324736e95bbe3c20d6079b0823b6d5e0d5622a24966e3f500dc887"}, {Index: "76", Address: "one1yg605zuc6z96k074rr37cjdw63e8aa8q47rapg", BLSPublicKey: "ec33858022e0f47684da5b206f5fa3af6718be795c324736e95bbe3c20d6079b0823b6d5e0d5622a24966e3f500dc887"},
{Index: "77", Address: "one1ytpfv5dxfy93ug2qxgjry0xclm4kur9efm6re4", BlsPublicKey: "c17e0f667de9ccb11d9b8e6f5213e09a8508c2c70a28ab3aa5d4c7ee8154d0906d677d18b124a91355efe140f3bafb8a"}, {Index: "77", Address: "one1ytpfv5dxfy93ug2qxgjry0xclm4kur9efm6re4", BLSPublicKey: "c17e0f667de9ccb11d9b8e6f5213e09a8508c2c70a28ab3aa5d4c7ee8154d0906d677d18b124a91355efe140f3bafb8a"},
{Index: "78", Address: "one1zpsatfzcxv8nudg7tvcek36muue2zew7hxg00f", BlsPublicKey: "5b4af2ba307819c7f3d8524c12149f24b9dba324907a5be382666a91de23ebfdd5056bc05935591c0b6d8ce6ebfa0703"}, {Index: "78", Address: "one1zpsatfzcxv8nudg7tvcek36muue2zew7hxg00f", BLSPublicKey: "5b4af2ba307819c7f3d8524c12149f24b9dba324907a5be382666a91de23ebfdd5056bc05935591c0b6d8ce6ebfa0703"},
{Index: "79", Address: "one1zyqstlj82sa93lz38hg87y962v39lptex5qh25", BlsPublicKey: "ed676ea671045fcc6f76d222de3d882896857e2d31421f6402ebfd795d0a053ccc43754fb114b6f1f4461923919ea98f"}, {Index: "79", Address: "one1zyqstlj82sa93lz38hg87y962v39lptex5qh25", BLSPublicKey: "ed676ea671045fcc6f76d222de3d882896857e2d31421f6402ebfd795d0a053ccc43754fb114b6f1f4461923919ea98f"},
} }

File diff suppressed because it is too large Load Diff

@ -220,7 +220,7 @@ func (s *PublicBlockChainAPI) GetBlockSigners(ctx context.Context, blockNr rpc.B
pubkeys := make([]*bls.PublicKey, len(committee.Slots)) pubkeys := make([]*bls.PublicKey, len(committee.Slots))
for i, validator := range committee.Slots { for i, validator := range committee.Slots {
pubkeys[i] = new(bls.PublicKey) pubkeys[i] = new(bls.PublicKey)
validator.BlsPublicKey.ToLibBLSPublicKey(pubkeys[i]) validator.BLSPublicKey.ToLibBLSPublicKey(pubkeys[i])
} }
result := make([]string, 0) result := make([]string, 0)
mask, err := internal_bls.NewMask(pubkeys, nil) mask, err := internal_bls.NewMask(pubkeys, nil)
@ -240,7 +240,7 @@ func (s *PublicBlockChainAPI) GetBlockSigners(ctx context.Context, blockNr rpc.B
return result, err return result, err
} }
blsPublicKey := new(bls.PublicKey) blsPublicKey := new(bls.PublicKey)
validator.BlsPublicKey.ToLibBLSPublicKey(blsPublicKey) validator.BLSPublicKey.ToLibBLSPublicKey(blsPublicKey)
if ok, err := mask.KeyEnabled(blsPublicKey); err == nil && ok { if ok, err := mask.KeyEnabled(blsPublicKey); err == nil && ok {
result = append(result, oneAddress) result = append(result, oneAddress)
} }
@ -268,7 +268,7 @@ func (s *PublicBlockChainAPI) IsBlockSigner(ctx context.Context, blockNr rpc.Blo
pubkeys := make([]*bls.PublicKey, len(committee.Slots)) pubkeys := make([]*bls.PublicKey, len(committee.Slots))
for i, validator := range committee.Slots { for i, validator := range committee.Slots {
pubkeys[i] = new(bls.PublicKey) pubkeys[i] = new(bls.PublicKey)
validator.BlsPublicKey.ToLibBLSPublicKey(pubkeys[i]) validator.BLSPublicKey.ToLibBLSPublicKey(pubkeys[i])
} }
mask, err := internal_bls.NewMask(pubkeys, nil) mask, err := internal_bls.NewMask(pubkeys, nil)
if err != nil { if err != nil {
@ -287,7 +287,7 @@ func (s *PublicBlockChainAPI) IsBlockSigner(ctx context.Context, blockNr rpc.Blo
continue continue
} }
blsPublicKey := new(bls.PublicKey) blsPublicKey := new(bls.PublicKey)
validator.BlsPublicKey.ToLibBLSPublicKey(blsPublicKey) validator.BLSPublicKey.ToLibBLSPublicKey(blsPublicKey)
if ok, err := mask.KeyEnabled(blsPublicKey); err == nil && ok { if ok, err := mask.KeyEnabled(blsPublicKey); err == nil && ok {
return true, nil return true, nil
} }

@ -190,7 +190,7 @@ func (s *PublicBlockChainAPI) GetBlockSigners(ctx context.Context, blockNr uint6
pubkeys := make([]*bls.PublicKey, len(committee.Slots)) pubkeys := make([]*bls.PublicKey, len(committee.Slots))
for i, validator := range committee.Slots { for i, validator := range committee.Slots {
pubkeys[i] = new(bls.PublicKey) pubkeys[i] = new(bls.PublicKey)
validator.BlsPublicKey.ToLibBLSPublicKey(pubkeys[i]) validator.BLSPublicKey.ToLibBLSPublicKey(pubkeys[i])
} }
result := make([]string, 0) result := make([]string, 0)
mask, err := internal_bls.NewMask(pubkeys, nil) mask, err := internal_bls.NewMask(pubkeys, nil)
@ -210,7 +210,7 @@ func (s *PublicBlockChainAPI) GetBlockSigners(ctx context.Context, blockNr uint6
return result, err return result, err
} }
blsPublicKey := new(bls.PublicKey) blsPublicKey := new(bls.PublicKey)
validator.BlsPublicKey.ToLibBLSPublicKey(blsPublicKey) validator.BLSPublicKey.ToLibBLSPublicKey(blsPublicKey)
if ok, err := mask.KeyEnabled(blsPublicKey); err == nil && ok { if ok, err := mask.KeyEnabled(blsPublicKey); err == nil && ok {
result = append(result, oneAddress) result = append(result, oneAddress)
} }
@ -238,7 +238,7 @@ func (s *PublicBlockChainAPI) IsBlockSigner(ctx context.Context, blockNr uint64,
pubkeys := make([]*bls.PublicKey, len(committee.Slots)) pubkeys := make([]*bls.PublicKey, len(committee.Slots))
for i, validator := range committee.Slots { for i, validator := range committee.Slots {
pubkeys[i] = new(bls.PublicKey) pubkeys[i] = new(bls.PublicKey)
validator.BlsPublicKey.ToLibBLSPublicKey(pubkeys[i]) validator.BLSPublicKey.ToLibBLSPublicKey(pubkeys[i])
} }
mask, err := internal_bls.NewMask(pubkeys, nil) mask, err := internal_bls.NewMask(pubkeys, nil)
if err != nil { if err != nil {
@ -257,7 +257,7 @@ func (s *PublicBlockChainAPI) IsBlockSigner(ctx context.Context, blockNr uint64,
continue continue
} }
blsPublicKey := new(bls.PublicKey) blsPublicKey := new(bls.PublicKey)
validator.BlsPublicKey.ToLibBLSPublicKey(blsPublicKey) validator.BLSPublicKey.ToLibBLSPublicKey(blsPublicKey)
if ok, err := mask.KeyEnabled(blsPublicKey); err == nil && ok { if ok, err := mask.KeyEnabled(blsPublicKey); err == nil && ok {
return true, nil return true, nil
} }

@ -82,17 +82,17 @@ func GetUniqueIDFromIPPort(ip, port string) uint32 {
return uint32(value) return uint32(value)
} }
// GetAddressFromBlsPubKey return the address object from bls pub key. // GetAddressFromBLSPubKey return the address object from bls pub key.
func GetAddressFromBlsPubKey(pubKey *bls.PublicKey) common.Address { func GetAddressFromBLSPubKey(pubKey *bls.PublicKey) common.Address {
addr := common.Address{} addr := common.Address{}
addrBytes := pubKey.GetAddress() addrBytes := pubKey.GetAddress()
addr.SetBytes(addrBytes[:]) addr.SetBytes(addrBytes[:])
return addr return addr
} }
// GetAddressFromBlsPubKeyBytes return the address object from bls pub key. // GetAddressFromBLSPubKeyBytes return the address object from bls pub key.
func GetAddressFromBlsPubKeyBytes(pubKeyBytes []byte) common.Address { func GetAddressFromBLSPubKeyBytes(pubKeyBytes []byte) common.Address {
pubKey, err := bls2.BytesToBlsPublicKey(pubKeyBytes[:]) pubKey, err := bls2.BytesToBLSPublicKey(pubKeyBytes[:])
addr := common.Address{} addr := common.Address{}
if err == nil { if err == nil {
addrBytes := pubKey.GetAddress() addrBytes := pubKey.GetAddress()

@ -542,7 +542,7 @@ func (node *Node) pingMessageHandler(msgPayload []byte, sender libp2p_peer.ID) i
utils.Logger().Debug(). utils.Logger().Debug().
Str("Version", ping.NodeVer). Str("Version", ping.NodeVer).
Str("BlsKey", peer.ConsensusPubKey.SerializeToHexStr()). Str("BLSKey", peer.ConsensusPubKey.SerializeToHexStr()).
Str("IP", peer.IP). Str("IP", peer.IP).
Str("Port", peer.Port). Str("Port", peer.Port).
Interface("PeerID", peer.PeerID). Interface("PeerID", peer.PeerID).

@ -42,7 +42,7 @@ func (node *Node) transitionIntoNextEpoch(shardState types.State) {
var publicKeys []*bls.PublicKey var publicKeys []*bls.PublicKey
for idx, nodeID := range myShardState.Slots { for idx, nodeID := range myShardState.Slots {
key := &bls.PublicKey{} key := &bls.PublicKey{}
err := key.Deserialize(nodeID.BlsPublicKey[:]) err := key.Deserialize(nodeID.BLSPublicKey[:])
if err != nil { if err != nil {
getLogger().Error("Failed to deserialize BLS public key in shard state", getLogger().Error("Failed to deserialize BLS public key in shard state",
"idx", idx, "idx", idx,
@ -71,7 +71,7 @@ func findRoleInShardState(
keyBytes := key.Serialize() keyBytes := key.Serialize()
for idx, shard := range state.Shards { for idx, shard := range state.Shards {
for nodeIdx, nodeID := range shard.Slots { for nodeIdx, nodeID := range shard.Slots {
if bytes.Compare(nodeID.BlsPublicKey[:], keyBytes) == 0 { if bytes.Compare(nodeID.BLSPublicKey[:], keyBytes) == 0 {
return uint32(idx), nodeIdx == 0 return uint32(idx), nodeIdx == 0
} }
} }

@ -24,11 +24,11 @@ type Peer struct {
} }
func (p Peer) String() string { func (p Peer) String() string {
BlsPubKey := "nil" BLSPubKey := "nil"
if p.ConsensusPubKey != nil { if p.ConsensusPubKey != nil {
BlsPubKey = p.ConsensusPubKey.SerializeToHexStr() BLSPubKey = p.ConsensusPubKey.SerializeToHexStr()
} }
return fmt.Sprintf("BlsPubKey:%s-%s/%s[%d]", BlsPubKey, net.JoinHostPort(p.IP, p.Port), p.PeerID, len(p.Addrs)) return fmt.Sprintf("BLSPubKey:%s-%s/%s[%d]", BLSPubKey, net.JoinHostPort(p.IP, p.Port), p.PeerID, len(p.Addrs))
} }
// GroupReceiver is a multicast group message receiver interface. // GroupReceiver is a multicast group message receiver interface.

@ -44,9 +44,9 @@ Commands:
12. blsRecovery - Recover non-human readable file. 12. blsRecovery - Recover non-human readable file.
--pass - The file containg the passphrase to decrypt the bls key. --pass - The file containg the passphrase to decrypt the bls key.
--file - Non-human readable bls file. --file - Non-human readable bls file.
13. importBls - Convert raw private key into encrypted bls key. 13. importBLS - Convert raw private key into encrypted bls key.
--key - Raw private key. --key - Raw private key.
14. getBlsPublic - Show Bls public key given raw private bls key. 14. getBLSPublic - Show BLS public key given raw private bls key.
--key - Raw private key. --key - Raw private key.
--file - encrypted bls file. --file - encrypted bls file.
EOT EOT

@ -126,7 +126,7 @@ func prepareOrders(
stakedReader StakingCandidatesReader, stakedReader StakingCandidatesReader,
) (map[common.Address]*effective.SlotOrder, error) { ) (map[common.Address]*effective.SlotOrder, error) {
candidates := stakedReader.ValidatorCandidates() candidates := stakedReader.ValidatorCandidates()
blsKeys := map[shard.BlsPublicKey]struct{}{} blsKeys := map[shard.BLSPublicKey]struct{}{}
essentials := map[common.Address]*effective.SlotOrder{} essentials := map[common.Address]*effective.SlotOrder{}
totalStaked, tempZero := big.NewInt(0), numeric.ZeroDec() totalStaked, tempZero := big.NewInt(0), numeric.ZeroDec()
@ -254,8 +254,8 @@ func preStakingEnabledCommittee(s shardingconfig.Instance) *shard.State {
for j := 0; j < shardHarmonyNodes; j++ { for j := 0; j < shardHarmonyNodes; j++ {
index := i + j*shardNum // The initial account to use for genesis nodes index := i + j*shardNum // The initial account to use for genesis nodes
pub := &bls.PublicKey{} pub := &bls.PublicKey{}
pub.DeserializeHexStr(hmyAccounts[index].BlsPublicKey) pub.DeserializeHexStr(hmyAccounts[index].BLSPublicKey)
pubKey := shard.BlsPublicKey{} pubKey := shard.BLSPublicKey{}
pubKey.FromLibBLSPublicKey(pub) pubKey.FromLibBLSPublicKey(pub)
// TODO: directly read address for bls too // TODO: directly read address for bls too
curNodeID := shard.Slot{ curNodeID := shard.Slot{
@ -269,8 +269,8 @@ func preStakingEnabledCommittee(s shardingconfig.Instance) *shard.State {
for j := shardHarmonyNodes; j < shardSize; j++ { for j := shardHarmonyNodes; j < shardSize; j++ {
index := i + (j-shardHarmonyNodes)*shardNum index := i + (j-shardHarmonyNodes)*shardNum
pub := &bls.PublicKey{} pub := &bls.PublicKey{}
pub.DeserializeHexStr(fnAccounts[index].BlsPublicKey) pub.DeserializeHexStr(fnAccounts[index].BLSPublicKey)
pubKey := shard.BlsPublicKey{} pubKey := shard.BLSPublicKey{}
pubKey.FromLibBLSPublicKey(pub) pubKey.FromLibBLSPublicKey(pub)
// TODO: directly read address for bls too // TODO: directly read address for bls too
curNodeID := shard.Slot{ curNodeID := shard.Slot{
@ -299,10 +299,10 @@ func eposStakedCommittee(
for j := 0; j < shardHarmonyNodes; j++ { for j := 0; j < shardHarmonyNodes; j++ {
index := i + j*shardCount index := i + j*shardCount
pub := &bls.PublicKey{} pub := &bls.PublicKey{}
if err := pub.DeserializeHexStr(hAccounts[index].BlsPublicKey); err != nil { if err := pub.DeserializeHexStr(hAccounts[index].BLSPublicKey); err != nil {
return nil, err return nil, err
} }
pubKey := shard.BlsPublicKey{} pubKey := shard.BLSPublicKey{}
if err := pubKey.FromLibBLSPublicKey(pub); err != nil { if err := pubKey.FromLibBLSPublicKey(pub); err != nil {
return nil, err return nil, err
} }

@ -21,7 +21,7 @@ import (
) )
var ( var (
emptyBlsPubKey = BlsPublicKey{} emptyBLSPubKey = BLSPublicKey{}
// ErrShardIDNotInSuperCommittee .. // ErrShardIDNotInSuperCommittee ..
ErrShardIDNotInSuperCommittee = errors.New("shardID not in super committee") ErrShardIDNotInSuperCommittee = errors.New("shardID not in super committee")
) )
@ -38,8 +38,8 @@ type State struct {
Shards []Committee `json:"shards"` Shards []Committee `json:"shards"`
} }
// BlsPublicKey defines the bls public key // BLSPublicKey defines the bls public key
type BlsPublicKey [PublicKeySizeInBytes]byte type BLSPublicKey [PublicKeySizeInBytes]byte
// BLSSignature defines the bls signature // BLSSignature defines the bls signature
type BLSSignature [BLSSignatureSizeInBytes]byte type BLSSignature [BLSSignatureSizeInBytes]byte
@ -47,7 +47,7 @@ type BLSSignature [BLSSignatureSizeInBytes]byte
// Slot represents node id (BLS address) // Slot represents node id (BLS address)
type Slot struct { type Slot struct {
EcdsaAddress common.Address `json:"ecdsa-address"` EcdsaAddress common.Address `json:"ecdsa-address"`
BlsPublicKey BlsPublicKey `json:"bls-pubkey"` BLSPublicKey BLSPublicKey `json:"bls-pubkey"`
// nil means our node, 0 means not active, > 0 means staked node // nil means our node, 0 means not active, > 0 means staked node
EffectiveStake *numeric.Dec `json:"effective-stake" rlp:"nil"` EffectiveStake *numeric.Dec `json:"effective-stake" rlp:"nil"`
} }
@ -64,7 +64,7 @@ type Committee struct {
func (l SlotList) String() string { func (l SlotList) String() string {
blsKeys := make([]string, len(l)) blsKeys := make([]string, len(l))
for i, k := range l { for i, k := range l {
blsKeys[i] = k.BlsPublicKey.Hex() blsKeys[i] = k.BLSPublicKey.Hex()
} }
s, _ := json.Marshal(blsKeys) s, _ := json.Marshal(blsKeys)
return string(s) return string(s)
@ -81,7 +81,7 @@ type StateLegacy []CommitteeLegacy
// SlotLegacy represents node id (BLS address) // SlotLegacy represents node id (BLS address)
type SlotLegacy struct { type SlotLegacy struct {
EcdsaAddress common.Address `json:"ecdsa-address"` EcdsaAddress common.Address `json:"ecdsa-address"`
BlsPublicKey BlsPublicKey `json:"bls-pubkey"` BLSPublicKey BLSPublicKey `json:"bls-pubkey"`
} }
// SlotListLegacy is a list of SlotList. // SlotListLegacy is a list of SlotList.
@ -113,7 +113,7 @@ func DecodeWrapper(shardState []byte) (*State, error) {
newSS.Shards[i] = Committee{ShardID: oldSS[i].ShardID, Slots: SlotList{}} newSS.Shards[i] = Committee{ShardID: oldSS[i].ShardID, Slots: SlotList{}}
for _, slot := range oldSS[i].Slots { for _, slot := range oldSS[i].Slots {
newSS.Shards[i].Slots = append(newSS.Shards[i].Slots, Slot{ newSS.Shards[i].Slots = append(newSS.Shards[i].Slots, Slot{
slot.EcdsaAddress, slot.BlsPublicKey, nil, slot.EcdsaAddress, slot.BLSPublicKey, nil,
}) })
} }
} }
@ -139,7 +139,7 @@ func EncodeWrapper(shardState State, isStaking bool) ([]byte, error) {
} }
for _, slot := range shardState.Shards[i].Slots { for _, slot := range shardState.Shards[i].Slots {
shardStateLegacy[i].Slots = append(shardStateLegacy[i].Slots, SlotLegacy{ shardStateLegacy[i].Slots = append(shardStateLegacy[i].Slots, SlotLegacy{
slot.EcdsaAddress, slot.BlsPublicKey, slot.EcdsaAddress, slot.BLSPublicKey,
}) })
} }
} }
@ -252,7 +252,7 @@ func (ss *State) MarshalJSON() ([]byte, error) {
dump[i].Count = c dump[i].Count = c
for j := range ss.Shards[i].Slots { for j := range ss.Shards[i].Slots {
n := ss.Shards[i].Slots[j] n := ss.Shards[i].Slots[j]
dump[i].NodeList[j].BlsPublicKey = n.BlsPublicKey dump[i].NodeList[j].BLSPublicKey = n.BLSPublicKey
dump[i].NodeList[j].EffectiveStake = n.EffectiveStake dump[i].NodeList[j].EffectiveStake = n.EffectiveStake
dump[i].NodeList[j].EcdsaAddress = common2.MustAddressToBech32(n.EcdsaAddress) dump[i].NodeList[j].EcdsaAddress = common2.MustAddressToBech32(n.EcdsaAddress)
} }
@ -287,23 +287,23 @@ func (ss *State) DeepCopy() *State {
} }
// Big .. // Big ..
func (pk BlsPublicKey) Big() *big.Int { func (pk BLSPublicKey) Big() *big.Int {
return new(big.Int).SetBytes(pk[:]) return new(big.Int).SetBytes(pk[:])
} }
// IsEmpty returns whether the bls public key is empty 0 bytes // IsEmpty returns whether the bls public key is empty 0 bytes
func (pk BlsPublicKey) IsEmpty() bool { func (pk BLSPublicKey) IsEmpty() bool {
return bytes.Compare(pk[:], emptyBlsPubKey[:]) == 0 return bytes.Compare(pk[:], emptyBLSPubKey[:]) == 0
} }
// Hex returns the hex string of bls public key // Hex returns the hex string of bls public key
func (pk BlsPublicKey) Hex() string { func (pk BLSPublicKey) Hex() string {
return hex.EncodeToString(pk[:]) return hex.EncodeToString(pk[:])
} }
// MarshalText so that we can use this as JSON printable when used as // MarshalText so that we can use this as JSON printable when used as
// key in a map // key in a map
func (pk BlsPublicKey) MarshalText() (text []byte, err error) { func (pk BLSPublicKey) MarshalText() (text []byte, err error) {
text = make([]byte, BLSSignatureSizeInBytes) text = make([]byte, BLSSignatureSizeInBytes)
hex.Encode(text, pk[:]) hex.Encode(text, pk[:])
return text, nil return text, nil
@ -311,8 +311,8 @@ func (pk BlsPublicKey) MarshalText() (text []byte, err error) {
// FromLibBLSPublicKeyUnsafe could give back nil, use only in cases when // FromLibBLSPublicKeyUnsafe could give back nil, use only in cases when
// have invariant that return value won't be nil // have invariant that return value won't be nil
func FromLibBLSPublicKeyUnsafe(key *bls.PublicKey) *BlsPublicKey { func FromLibBLSPublicKeyUnsafe(key *bls.PublicKey) *BLSPublicKey {
result := &BlsPublicKey{} result := &BLSPublicKey{}
if err := result.FromLibBLSPublicKey(key); err != nil { if err := result.FromLibBLSPublicKey(key); err != nil {
return nil return nil
} }
@ -320,7 +320,7 @@ func FromLibBLSPublicKeyUnsafe(key *bls.PublicKey) *BlsPublicKey {
} }
// FromLibBLSPublicKey replaces the key contents with the given key, // FromLibBLSPublicKey replaces the key contents with the given key,
func (pk *BlsPublicKey) FromLibBLSPublicKey(key *bls.PublicKey) error { func (pk *BLSPublicKey) FromLibBLSPublicKey(key *bls.PublicKey) error {
bytes := key.Serialize() bytes := key.Serialize()
if len(bytes) != len(pk) { if len(bytes) != len(pk) {
return ctxerror.New("BLS public key size mismatch", return ctxerror.New("BLS public key size mismatch",
@ -332,12 +332,12 @@ func (pk *BlsPublicKey) FromLibBLSPublicKey(key *bls.PublicKey) error {
} }
// ToLibBLSPublicKey copies the key contents into the given key. // ToLibBLSPublicKey copies the key contents into the given key.
func (pk *BlsPublicKey) ToLibBLSPublicKey(key *bls.PublicKey) error { func (pk *BLSPublicKey) ToLibBLSPublicKey(key *bls.PublicKey) error {
return key.Deserialize(pk[:]) return key.Deserialize(pk[:])
} }
// CompareBlsPublicKey compares two BlsPublicKey, lexicographically. // CompareBLSPublicKey compares two BLSPublicKey, lexicographically.
func CompareBlsPublicKey(k1, k2 BlsPublicKey) int { func CompareBLSPublicKey(k1, k2 BLSPublicKey) int {
return bytes.Compare(k1[:], k2[:]) return bytes.Compare(k1[:], k2[:])
} }
@ -346,7 +346,7 @@ func CompareNodeID(id1, id2 *Slot) int {
if c := bytes.Compare(id1.EcdsaAddress[:], id2.EcdsaAddress[:]); c != 0 { if c := bytes.Compare(id1.EcdsaAddress[:], id2.EcdsaAddress[:]); c != 0 {
return c return c
} }
if c := CompareBlsPublicKey(id1.BlsPublicKey, id2.BlsPublicKey); c != 0 { if c := CompareBLSPublicKey(id1.BLSPublicKey, id2.BLSPublicKey); c != 0 {
return c return c
} }
return 0 return 0
@ -403,7 +403,7 @@ func lookupBLSPublicKeys(
slice := make([]*bls.PublicKey, len(c.Slots)) slice := make([]*bls.PublicKey, len(c.Slots))
for j := range c.Slots { for j := range c.Slots {
committerKey := &bls.PublicKey{} committerKey := &bls.PublicKey{}
if err := c.Slots[j].BlsPublicKey.ToLibBLSPublicKey( if err := c.Slots[j].BLSPublicKey.ToLibBLSPublicKey(
committerKey, committerKey,
); err != nil { ); err != nil {
return nil, err return nil, err
@ -443,13 +443,13 @@ var (
) )
// AddressForBLSKey .. // AddressForBLSKey ..
func (c *Committee) AddressForBLSKey(key BlsPublicKey) (*common.Address, error) { func (c *Committee) AddressForBLSKey(key BLSPublicKey) (*common.Address, error) {
if c == nil { if c == nil {
return nil, ErrSubCommitteeNil return nil, ErrSubCommitteeNil
} }
for _, slot := range c.Slots { for _, slot := range c.Slots {
if CompareBlsPublicKey(slot.BlsPublicKey, key) == 0 { if CompareBLSPublicKey(slot.BLSPublicKey, key) == 0 {
return &slot.EcdsaAddress, nil return &slot.EcdsaAddress, nil
} }
} }
@ -504,7 +504,7 @@ func (ss *State) Hash() (h common.Hash) {
// Serialize serialize Slot into bytes // Serialize serialize Slot into bytes
func (n Slot) Serialize() []byte { func (n Slot) Serialize() []byte {
return append(n.EcdsaAddress[:], n.BlsPublicKey[:]...) return append(n.EcdsaAddress[:], n.BLSPublicKey[:]...)
} }
func (n Slot) String() string { func (n Slot) String() string {
@ -512,5 +512,10 @@ func (n Slot) String() string {
if n.EffectiveStake != nil { if n.EffectiveStake != nil {
total = n.EffectiveStake.String() total = n.EffectiveStake.String()
} }
return "ECDSA: " + common2.MustAddressToBech32(n.EcdsaAddress) + ", BLS: " + hex.EncodeToString(n.BlsPublicKey[:]) + ", EffectiveStake: " + total return "ECDSA: " +
common2.MustAddressToBech32(n.EcdsaAddress) +
", BLS: " +
hex.EncodeToString(n.BLSPublicKey[:]) +
", EffectiveStake: " +
total
} }

@ -17,10 +17,7 @@ import (
) )
var ( var (
measure = numeric.NewDec(2).Quo(numeric.NewDec(3)) measure = numeric.NewDec(2).Quo(numeric.NewDec(3))
errValidatorEpochDeviation = errors.New(
"validator snapshot epoch not exactly one epoch behind",
)
// ErrDivByZero .. // ErrDivByZero ..
ErrDivByZero = errors.New("toSign of availability cannot be 0, mistake in protocol") ErrDivByZero = errors.New("toSign of availability cannot be 0, mistake in protocol")
) )
@ -227,12 +224,8 @@ func ComputeAndMutateEPOSStatus(
computed := ComputeCurrentSigning(snapshot, wrapper) computed := ComputeCurrentSigning(snapshot, wrapper)
utils.Logger().Info(). utils.Logger().
Str("signed", computed.Signed.String()). Info().Msg("check if signing percent is meeting required threshold")
Str("to-sign", computed.ToSign.String()).
Str("percentage-signed", computed.Percentage.String()).
Bool("is-below-threshold", computed.IsBelowThreshold).
Msg("check if signing percent is meeting required threshold")
const missedTooManyBlocks = true const missedTooManyBlocks = true

@ -29,7 +29,7 @@ func effectiveStake(median, actual numeric.Dec) numeric.Dec {
// SlotPurchase .. // SlotPurchase ..
type SlotPurchase struct { type SlotPurchase struct {
Addr common.Address `json:"slot-owner"` Addr common.Address `json:"slot-owner"`
Key shard.BlsPublicKey `json:"bls-public-key"` Key shard.BLSPublicKey `json:"bls-public-key"`
Stake numeric.Dec `json:"eposed-stake"` Stake numeric.Dec `json:"eposed-stake"`
} }
@ -49,7 +49,7 @@ func (p SlotPurchase) MarshalJSON() ([]byte, error) {
// SlotOrder .. // SlotOrder ..
type SlotOrder struct { type SlotOrder struct {
Stake *big.Int `json:"stake"` Stake *big.Int `json:"stake"`
SpreadAmong []shard.BlsPublicKey `json:"keys-at-auction"` SpreadAmong []shard.BLSPublicKey `json:"keys-at-auction"`
Percentage numeric.Dec `json:"percentage-of-total-auction-stake"` Percentage numeric.Dec `json:"percentage-of-total-auction-stake"`
} }

@ -60,7 +60,7 @@ func generateRandomSlots(num int) []SlotPurchase {
addr.SetBytes(big.NewInt(int64(accountGen.Int63n(maxAccountGen))).Bytes()) addr.SetBytes(big.NewInt(int64(accountGen.Int63n(maxAccountGen))).Bytes())
secretKey := bls.SecretKey{} secretKey := bls.SecretKey{}
secretKey.Deserialize(big.NewInt(int64(keyGen.Int63n(maxKeyGen))).Bytes()) secretKey.Deserialize(big.NewInt(int64(keyGen.Int63n(maxKeyGen))).Bytes())
key := shard.BlsPublicKey{} key := shard.BLSPublicKey{}
key.FromLibBLSPublicKey(secretKey.GetPublicKey()) key.FromLibBLSPublicKey(secretKey.GetPublicKey())
stake := numeric.NewDecFromBigInt(big.NewInt(int64(stakeGen.Int63n(maxStakeGen)))) stake := numeric.NewDecFromBigInt(big.NewInt(int64(stakeGen.Int63n(maxStakeGen))))
randomSlots = append(randomSlots, SlotPurchase{addr, key, stake}) randomSlots = append(randomSlots, SlotPurchase{addr, key, stake})

@ -183,7 +183,7 @@ func Verify(
return errors.Wrapf(errSlashBlockNoConflict, "first %v+ second %v+", first, second) return errors.Wrapf(errSlashBlockNoConflict, "first %v+ second %v+", first, second)
} }
if shard.CompareBlsPublicKey(first.SignerPubKey, second.SignerPubKey) != 0 { if shard.CompareBLSPublicKey(first.SignerPubKey, second.SignerPubKey) != 0 {
k1, k2 := first.SignerPubKey.Hex(), second.SignerPubKey.Hex() k1, k2 := first.SignerPubKey.Hex(), second.SignerPubKey.Hex()
return errors.Wrapf( return errors.Wrapf(
errBallotSignerKeysNotSame, "%s %s", k1, k2, errBallotSignerKeysNotSame, "%s %s", k1, k2,

@ -250,7 +250,7 @@ var (
reporterAddr, offenderAddr = common.Address{}, common.Address{} reporterAddr, offenderAddr = common.Address{}, common.Address{}
randoDel = common.Address{} randoDel = common.Address{}
header = block.Header{} header = block.Header{}
subCommittee = []shard.BlsPublicKey{} subCommittee = []shard.BLSPublicKey{}
doubleSignEpochBig = big.NewInt(doubleSignEpoch) doubleSignEpochBig = big.NewInt(doubleSignEpoch)
unit = func() interface{} { unit = func() interface{} {
@ -296,7 +296,7 @@ func (s *scenario) defaultValidatorPair(
validatorSnapshot := &staking.ValidatorWrapper{ validatorSnapshot := &staking.ValidatorWrapper{
Validator: staking.Validator{ Validator: staking.Validator{
Address: offenderAddr, Address: offenderAddr,
SlotPubKeys: []shard.BlsPublicKey{blsWrapA}, SlotPubKeys: []shard.BLSPublicKey{blsWrapA},
LastEpochInCommittee: big.NewInt(lastEpochInComm), LastEpochInCommittee: big.NewInt(lastEpochInComm),
MinSelfDelegation: tenKOnes, //new(big.Int).SetUint64(1 * denominations.One), MinSelfDelegation: tenKOnes, //new(big.Int).SetUint64(1 * denominations.One),
MaxTotalDelegation: hundredKOnes, //new(big.Int).SetUint64(10 * denominations.One), MaxTotalDelegation: hundredKOnes, //new(big.Int).SetUint64(10 * denominations.One),
@ -311,7 +311,7 @@ func (s *scenario) defaultValidatorPair(
validatorCurrent := &staking.ValidatorWrapper{ validatorCurrent := &staking.ValidatorWrapper{
Validator: staking.Validator{ Validator: staking.Validator{
Address: offenderAddr, Address: offenderAddr,
SlotPubKeys: []shard.BlsPublicKey{blsWrapA}, SlotPubKeys: []shard.BLSPublicKey{blsWrapA},
LastEpochInCommittee: big.NewInt(lastEpochInComm + 1), LastEpochInCommittee: big.NewInt(lastEpochInComm + 1),
MinSelfDelegation: tenKOnes, // new(big.Int).SetUint64(1 * denominations.One), MinSelfDelegation: tenKOnes, // new(big.Int).SetUint64(1 * denominations.One),
MaxTotalDelegation: hundredKOnes, // new(big.Int).SetUint64(10 * denominations.One), MaxTotalDelegation: hundredKOnes, // new(big.Int).SetUint64(10 * denominations.One),
@ -435,7 +435,7 @@ func (mockOutChainReader) ReadShardState(epoch *big.Int) (*shard.State, error) {
Slots: shard.SlotList{ Slots: shard.SlotList{
shard.Slot{ shard.Slot{
EcdsaAddress: offenderAddr, EcdsaAddress: offenderAddr,
BlsPublicKey: blsWrapA, BLSPublicKey: blsWrapA,
EffectiveStake: nil, EffectiveStake: nil,
}, },
}, },

@ -59,7 +59,7 @@ type CreateValidator struct {
CommissionRates `json:"commission"` CommissionRates `json:"commission"`
MinSelfDelegation *big.Int `json:"min-self-delegation"` MinSelfDelegation *big.Int `json:"min-self-delegation"`
MaxTotalDelegation *big.Int `json:"max-total-delegation"` MaxTotalDelegation *big.Int `json:"max-total-delegation"`
SlotPubKeys []shard.BlsPublicKey `json:"slot-pub-keys"` SlotPubKeys []shard.BLSPublicKey `json:"slot-pub-keys"`
SlotKeySigs []shard.BLSSignature `json:"slot-key-sigs"` SlotKeySigs []shard.BLSSignature `json:"slot-key-sigs"`
Amount *big.Int `json:"amount"` Amount *big.Int `json:"amount"`
} }
@ -71,8 +71,8 @@ type EditValidator struct {
CommissionRate *numeric.Dec `json:"commission-rate" rlp:"nil"` CommissionRate *numeric.Dec `json:"commission-rate" rlp:"nil"`
MinSelfDelegation *big.Int `json:"min-self-delegation" rlp:"nil"` MinSelfDelegation *big.Int `json:"min-self-delegation" rlp:"nil"`
MaxTotalDelegation *big.Int `json:"max-total-delegation" rlp:"nil"` MaxTotalDelegation *big.Int `json:"max-total-delegation" rlp:"nil"`
SlotKeyToRemove *shard.BlsPublicKey `json:"slot-key-to_remove" rlp:"nil"` SlotKeyToRemove *shard.BLSPublicKey `json:"slot-key-to_remove" rlp:"nil"`
SlotKeyToAdd *shard.BlsPublicKey `json:"slot-key-to_add" rlp:"nil"` SlotKeyToAdd *shard.BLSPublicKey `json:"slot-key-to_add" rlp:"nil"`
SlotKeyToAddSig *shard.BLSSignature `json:"slot-key-to-add-sig" rlp:"nil"` SlotKeyToAddSig *shard.BLSSignature `json:"slot-key-to-add-sig" rlp:"nil"`
EPOSStatus effective.Eligibility `json:"epos-eligibility-status" rlp:"nil"` EPOSStatus effective.Eligibility `json:"epos-eligibility-status" rlp:"nil"`
} }

@ -15,7 +15,7 @@ package types
// maxRate := NewDecWithPrec(2, 2) // 20% // maxRate := NewDecWithPrec(2, 2) // 20%
// maxChangeRate := NewDecWithPrec(1, 3) // 1% // maxChangeRate := NewDecWithPrec(1, 3) // 1%
// blsPublickey := shard.BlsPublicKey{} // blsPublickey := shard.BLSPublicKey{}
// blsPublickey.FromLibBLSPublicKey(blsPubKey) // blsPublickey.FromLibBLSPublicKey(blsPubKey)
// msgCreateValidator := NewMsgCreateValidator(Description{ // msgCreateValidator := NewMsgCreateValidator(Description{
@ -66,7 +66,7 @@ package types
// t.Error("StakingAddress does not match") // t.Error("StakingAddress does not match")
// } // }
// if shard.CompareBlsPublicKey(decodedMsg.ValidatingPubKey, msgCreateValidator.ValidatingPubKey) != 0 { // if shard.CompareBLSPublicKey(decodedMsg.ValidatingPubKey, msgCreateValidator.ValidatingPubKey) != 0 {
// t.Error("ValidatingPubKey does not match") // t.Error("ValidatingPubKey does not match")
// } // }
@ -78,7 +78,7 @@ package types
// func TestMsgEditValidatorRLP(t *testing.T) { // func TestMsgEditValidatorRLP(t *testing.T) {
// commissionRate := NewDecWithPrec(1, 2) // 10% // commissionRate := NewDecWithPrec(1, 2) // 10%
// blsPublickey := shard.BlsPublicKey{} // blsPublickey := shard.BLSPublicKey{}
// blsPublickey.FromLibBLSPublicKey(blsPubKey) // blsPublickey.FromLibBLSPublicKey(blsPubKey)
// msgEditValidator := NewMsgEditValidator(Description{ // msgEditValidator := NewMsgEditValidator(Description{

@ -40,7 +40,7 @@ func CreateTestNewTransaction() (*StakingTransaction, error) {
stakePayloadMaker := func() (Directive, interface{}) { stakePayloadMaker := func() (Directive, interface{}) {
p := &bls.PublicKey{} p := &bls.PublicKey{}
p.DeserializeHexStr(testBLSPubKey) p.DeserializeHexStr(testBLSPubKey)
pub := shard.BlsPublicKey{} pub := shard.BLSPublicKey{}
pub.FromLibBLSPublicKey(p) pub.FromLibBLSPublicKey(p)
ra, _ := numeric.NewDecFromStr("0.7") ra, _ := numeric.NewDecFromStr("0.7")
@ -62,7 +62,7 @@ func CreateTestNewTransaction() (*StakingTransaction, error) {
MinSelfDelegation: big.NewInt(10), MinSelfDelegation: big.NewInt(10),
MaxTotalDelegation: big.NewInt(3000), MaxTotalDelegation: big.NewInt(3000),
ValidatorAddress: common.Address(dAddr), ValidatorAddress: common.Address(dAddr),
SlotPubKeys: []shard.BlsPublicKey{pub}, SlotPubKeys: []shard.BLSPublicKey{pub},
Amount: big.NewInt(100), Amount: big.NewInt(100),
} }
} }
@ -88,7 +88,7 @@ func TestTransactionCopy(t *testing.T) {
p := &bls.PublicKey{} p := &bls.PublicKey{}
p.DeserializeHexStr(testBLSPubKey2) p.DeserializeHexStr(testBLSPubKey2)
pub := shard.BlsPublicKey{} pub := shard.BLSPublicKey{}
pub.FromLibBLSPublicKey(p) pub.FromLibBLSPublicKey(p)
cv1.SlotPubKeys = append(cv1.SlotPubKeys, pub) cv1.SlotPubKeys = append(cv1.SlotPubKeys, pub)

@ -26,7 +26,7 @@ const (
MaxWebsiteLength = 140 MaxWebsiteLength = 140
MaxSecurityContactLength = 140 MaxSecurityContactLength = 140
MaxDetailsLength = 280 MaxDetailsLength = 280
BlsVerificationStr = "harmony-one" BLSVerificationStr = "harmony-one"
TenThousand = 10000 TenThousand = 10000
) )
@ -187,7 +187,7 @@ type Validator struct {
// ECDSA address of the validator // ECDSA address of the validator
Address common.Address `json:"address"` Address common.Address `json:"address"`
// The BLS public key of the validator for consensus // The BLS public key of the validator for consensus
SlotPubKeys []shard.BlsPublicKey `json:"bls-public-keys"` SlotPubKeys []shard.BLSPublicKey `json:"bls-public-keys"`
// The number of the last epoch this validator is // The number of the last epoch this validator is
// selected in committee (0 means never selected) // selected in committee (0 means never selected)
LastEpochInCommittee *big.Int `json:"last-epoch-in-committee"` LastEpochInCommittee *big.Int `json:"last-epoch-in-committee"`
@ -288,7 +288,7 @@ func (v *Validator) SanityCheck(oneThirdExtrn int) error {
) )
} }
allKeys := map[shard.BlsPublicKey]struct{}{} allKeys := map[shard.BLSPublicKey]struct{}{}
for i := range v.SlotPubKeys { for i := range v.SlotPubKeys {
if _, ok := allKeys[v.SlotPubKeys[i]]; !ok { if _, ok := allKeys[v.SlotPubKeys[i]]; !ok {
allKeys[v.SlotPubKeys[i]] = struct{}{} allKeys[v.SlotPubKeys[i]] = struct{}{}
@ -435,7 +435,7 @@ func (d Description) EnsureLength() (Description, error) {
// VerifyBLSKeys checks if the public BLS key at index i of pubKeys matches the // VerifyBLSKeys checks if the public BLS key at index i of pubKeys matches the
// BLS key signature at index i of pubKeysSigs. // BLS key signature at index i of pubKeysSigs.
func VerifyBLSKeys(pubKeys []shard.BlsPublicKey, pubKeySigs []shard.BLSSignature) error { func VerifyBLSKeys(pubKeys []shard.BLSPublicKey, pubKeySigs []shard.BLSSignature) error {
if len(pubKeys) != len(pubKeySigs) { if len(pubKeys) != len(pubKeySigs) {
return errBLSKeysNotMatchSigs return errBLSKeysNotMatchSigs
} }
@ -450,7 +450,7 @@ func VerifyBLSKeys(pubKeys []shard.BlsPublicKey, pubKeySigs []shard.BLSSignature
} }
// VerifyBLSKey checks if the public BLS key matches the BLS signature // VerifyBLSKey checks if the public BLS key matches the BLS signature
func VerifyBLSKey(pubKey *shard.BlsPublicKey, pubKeySig *shard.BLSSignature) error { func VerifyBLSKey(pubKey *shard.BLSPublicKey, pubKeySig *shard.BLSSignature) error {
if len(pubKeySig) == 0 { if len(pubKeySig) == 0 {
return errBLSKeysNotMatchSigs return errBLSKeysNotMatchSigs
} }
@ -465,7 +465,7 @@ func VerifyBLSKey(pubKey *shard.BlsPublicKey, pubKeySig *shard.BLSSignature) err
return err return err
} }
messageBytes := []byte(BlsVerificationStr) messageBytes := []byte(BLSVerificationStr)
msgHash := hash.Keccak256(messageBytes) msgHash := hash.Keccak256(messageBytes)
if !msgSig.VerifyHash(blsPubKey, msgHash[:]) { if !msgSig.VerifyHash(blsPubKey, msgHash[:]) {
return errBLSKeysNotMatchSigs return errBLSKeysNotMatchSigs
@ -475,7 +475,7 @@ func VerifyBLSKey(pubKey *shard.BlsPublicKey, pubKeySig *shard.BLSSignature) err
} }
func containsHarmonyBLSKeys( func containsHarmonyBLSKeys(
blsKeys []shard.BlsPublicKey, blsKeys []shard.BLSPublicKey,
hmyAccounts []genesis.DeployAccount, hmyAccounts []genesis.DeployAccount,
epoch *big.Int, epoch *big.Int,
) error { ) error {
@ -490,7 +490,7 @@ func containsHarmonyBLSKeys(
} }
func matchesHarmonyBLSKey( func matchesHarmonyBLSKey(
blsKey *shard.BlsPublicKey, blsKey *shard.BLSPublicKey,
hmyAccounts []genesis.DeployAccount, hmyAccounts []genesis.DeployAccount,
epoch *big.Int, epoch *big.Int,
) error { ) error {
@ -503,7 +503,7 @@ func matchesHarmonyBLSKey(
cache[key] = map[publicKeyAsHex]struct{}{} cache[key] = map[publicKeyAsHex]struct{}{}
for i := range hmyAccounts { for i := range hmyAccounts {
// invariant assume it is hex // invariant assume it is hex
cache[key][hmyAccounts[i].BlsPublicKey] = struct{}{} cache[key][hmyAccounts[i].BLSPublicKey] = struct{}{}
} }
} }

@ -78,17 +78,17 @@ var (
) )
// Using public keys to create slot for validator // Using public keys to create slot for validator
func setSlotPubKeys() []shard.BlsPublicKey { func setSlotPubKeys() []shard.BLSPublicKey {
p := &bls.PublicKey{} p := &bls.PublicKey{}
p.DeserializeHexStr(blsPubKey) p.DeserializeHexStr(blsPubKey)
pub := shard.BlsPublicKey{} pub := shard.BLSPublicKey{}
pub.FromLibBLSPublicKey(p) pub.FromLibBLSPublicKey(p)
return []shard.BlsPublicKey{pub} return []shard.BLSPublicKey{pub}
} }
// Using private keys to create sign slot for message.CreateValidator // Using private keys to create sign slot for message.CreateValidator
func setSlotKeySigs() []shard.BLSSignature { func setSlotKeySigs() []shard.BLSSignature {
messageBytes := []byte(BlsVerificationStr) messageBytes := []byte(BLSVerificationStr)
privateKey := &bls.SecretKey{} privateKey := &bls.SecretKey{}
privateKey.DeserializeHexStr(blsPriKey) privateKey.DeserializeHexStr(blsPriKey)
msgHash := hash.Keccak256(messageBytes) msgHash := hash.Keccak256(messageBytes)

@ -31,12 +31,12 @@ func init() {
bls.Init(bls.BLS12_381) bls.Init(bls.BLS12_381)
} }
func generateBlsKeySigPair() (shard.BlsPublicKey, shard.BLSSignature) { func generateBLSKeySigPair() (shard.BLSPublicKey, shard.BLSSignature) {
p := &bls.PublicKey{} p := &bls.PublicKey{}
p.DeserializeHexStr(testBLSPubKey) p.DeserializeHexStr(testBLSPubKey)
pub := shard.BlsPublicKey{} pub := shard.BLSPublicKey{}
pub.FromLibBLSPublicKey(p) pub.FromLibBLSPublicKey(p)
messageBytes := []byte(staking.BlsVerificationStr) messageBytes := []byte(staking.BLSVerificationStr)
privateKey := &bls.SecretKey{} privateKey := &bls.SecretKey{}
privateKey.DeserializeHexStr(testBLSPrvKey) privateKey.DeserializeHexStr(testBLSPrvKey)
msgHash := hash.Keccak256(messageBytes) msgHash := hash.Keccak256(messageBytes)
@ -64,8 +64,8 @@ func createValidator() *staking.CreateValidator {
} }
minSelfDel := big.NewInt(1e18) minSelfDel := big.NewInt(1e18)
maxTotalDel := big.NewInt(9e18) maxTotalDel := big.NewInt(9e18)
pubKey, pubSig := generateBlsKeySigPair() pubKey, pubSig := generateBLSKeySigPair()
slotPubKeys := []shard.BlsPublicKey{pubKey} slotPubKeys := []shard.BLSPublicKey{pubKey}
slotKeySigs := []shard.BLSSignature{pubSig} slotKeySigs := []shard.BLSSignature{pubSig}
amount := big.NewInt(5e18) amount := big.NewInt(5e18)
v := staking.CreateValidator{ v := staking.CreateValidator{

@ -31,7 +31,7 @@ func main() {
fmt.Println() fmt.Println()
fmt.Printf("// %d - %d\n", i, i+9) fmt.Printf("// %d - %d\n", i, i+9)
} }
fmt.Printf("{Address: \"%s\", BlsPriKey: \"%s\"},\n", genesis.NewNodeAccounts[i].Address, sec.SerializeToHexStr()) fmt.Printf("{Address: \"%s\", BLSPriKey: \"%s\"},\n", genesis.NewNodeAccounts[i].Address, sec.SerializeToHexStr())
if i == 0 { if i == 0 {
aggSig = sec.Sign(m) aggSig = sec.Sign(m)
aggPub = sec.GetPublicKey() aggPub = sec.GetPublicKey()

Loading…
Cancel
Save