From 326226d5ed033223c753dacf0a60c514dc38a56d Mon Sep 17 00:00:00 2001 From: Vincent Botbol Date: Thu, 12 Apr 2018 11:08:07 +0200 Subject: [PATCH] Genesis: add mnemonics, passwords and emails to genesis info generation --- scripts/create_genesis/create_genesis_info.py | 77 +++++++++---- scripts/create_genesis/sandbox_commitments | 108 ++++++++++++++++++ scripts/protocol_parameters.json | 12 -- src/bin_client/test/protocol_parameters.json | 23 ++-- .../lib_baking/test/proto_alpha_helpers.ml | 20 ++-- .../lib_protocol/test/helpers/helpers_init.ml | 20 ++-- .../lib_protocol/test/test_activation.ml | 24 +--- 7 files changed, 200 insertions(+), 84 deletions(-) create mode 100644 scripts/create_genesis/sandbox_commitments diff --git a/scripts/create_genesis/create_genesis_info.py b/scripts/create_genesis/create_genesis_info.py index f7e9f81af..f00a3a887 100755 --- a/scripts/create_genesis/create_genesis_info.py +++ b/scripts/create_genesis/create_genesis_info.py @@ -8,6 +8,24 @@ import binascii import numpy as np import pysodium from pyblake2 import blake2b +import unicodedata +import pysodium +from hashlib import sha256 +import random +import string + +def get_keys(mnemonic, email, password): + salt = unicodedata.normalize( + "NFKD", (email + password).decode("utf8")).encode("utf8") + seed = bitcoin.mnemonic_to_seed(mnemonic, salt) + pk, sk = pysodium.crypto_sign_seed_keypair(seed[0:32]) + pkh = blake2b(pk,20).digest() + pkhb58 = bitcoin.bin_to_b58check(pkh, magicbyte=434591) + return (sk, pk, pkh, pkhb58) + +def random_email(): + rnd = lambda n: ''.join(random.choice(string.ascii_lowercase) for _ in range(n)) + return '%s.%s@tezos.example.org' % (rnd(8),rnd(8)) def tez_to_int(amount): return int(round(amount * 1e6, 0)) @@ -41,15 +59,16 @@ def genesis_commitments(wallets, blind): for pkh_b58, amount in wallets.iteritems(): # Public key hash corresponding to this Tezos address. pkh = bitcoin.b58check_to_bin(pkh_b58)[2:] + hpkh_b58 = bitcoin.bin_to_b58check((pkh[:10] + '\000' * 10), magicbyte=434591) # The redemption code is unique to the public key hash and deterministically # constructed using a secret blinding value. secret = secret_code(pkh, blind) # The redemption code is used to blind the pkh blinded_pkh = blake2b(pkh, 20, key=secret).digest() commitment = { - 'half_pkh': binascii.hexlify(pkh[:10]), - 'blinded_pkh': binascii.hexlify(blinded_pkh), - 'amount': tez_to_int(amount) + 'half_pkh': hpkh_b58, + 'blinded_pkh': bitcoin.bin_to_b58check(blinded_pkh, magicbyte=16921055), + 'amount': amount } commitments.append(commitment) return commitments @@ -59,19 +78,20 @@ def make_dummy_wallets(n, blind): # Not a realistic shape, but for an alphanet faucet it's better to # have less variance. amounts = np.random.pareto(10.0, n) - amounts = amounts / sum(amounts) * 760e6 + amounts = amounts / sum(amounts) * 700e6 wallets = {} - secret_seeds = {} + secrets = {} for i in range(0, n): - seed = blake2b(str(i), 32, key=blind).digest() - pk, sk = pysodium.crypto_sign_seed_keypair(seed) - pkh = blake2b(pk, 20).digest() - pkh_b58 = bitcoin.bin_to_b58check(pkh, magicbyte=434591) + entropy = blake2b(str(i), 20, key=blind).digest() + mnemonic = bitcoin.mnemonic.entropy_to_words(entropy) + password = ''.join(random.choice(string.letters + string.digits) for _ in range(10)) + email = random_email() + sk, pk, pkh, pkh_b58 = get_keys(' '.join(mnemonic), email, password) amount = tez_to_int(amounts[i]) wallets[pkh_b58] = amount secret = secret_code(pkh, blind) - secret_seeds[pkh_b58] = (bitcoin.bin_to_b58check(seed, magicbyte=219101703), amount, binascii.hexlify(secret)) - return wallets, secret_seeds + secrets[pkh_b58] = (mnemonic, email, password, amount, binascii.hexlify(secret)) + return wallets, secrets if __name__ == '__main__': if len(sys.argv) < 3: @@ -79,18 +99,35 @@ if __name__ == '__main__': exit(1) blind = sys.argv[2] if len(sys.argv) == 4 and sys.argv[3] == "dummy": - wallets, secret_seeds = make_dummy_wallets(30000, blind) + wallets, secrets = make_dummy_wallets(30000, blind) with open('secret_seeds.json', 'w') as f: - json.dump([(pkh, sk, a, r) for pkh, (sk, a, r) in secret_seeds.iteritems()], f, indent=1) + json.dump([ { "pkh" : pkh, + "mnemonic" : mnemonic, + "email" : email, + "password" : password, + "amount" : str(amount), + "secret" : secret } + for pkh, (mnemonic, email, password, amount, secret) in secrets.iteritems()], f, indent=1) else: wallets = get_wallets( sys.argv[1] ) commitments = genesis_commitments(wallets, blind) - print "let commitments = [" - print ";\n".join([ '"%s", "%s", %d' % - ( commitment['half_pkh'], - commitment['blinded_pkh'], - commitment['amount'] ) - for commitment in commitments if commitment['amount'] > 0]) - print "]" + with open('commitments.json', 'w') as f: + json.dump({ "bootstrap_accounts": [ + [ "edsk4X12XaKRPHgDkgvMe4UWEiygx8AVrt9rpktmhu1uT2GCPU4dp7", + "12000000000000" ], + [ "edsk46ypB8PztxMDPMdVnEgjQmJhca7zMJvTMDrdwJaJ4mgm4qNmwE", + "12000000000000" ], + [ "edsk4JsBpWJH5cDtanNADY2D5Ygma1dUtxko8qaM2Af8FHGU52yLcW", + "12000000000000" ], + [ "edsk3b5GrQdRF1Pt3ccRjvyoNHTFrSXUKZufg2zQYhBumqS8kMfeGC", + "12000000000000" ], + [ "edsk3T8CRr8YK2vnjsZK2vDzCjpcWpMEUXMAzjeR1GWjmyhGaDHTNV", + "12000000000000" ] + ], + "commitments": + [ (commitment['half_pkh'], + commitment['blinded_pkh'], + str(commitment['amount'])) + for commitment in commitments if commitment['amount'] > 0]}, f, indent=1) diff --git a/scripts/create_genesis/sandbox_commitments b/scripts/create_genesis/sandbox_commitments new file mode 100644 index 000000000..5021d9be6 --- /dev/null +++ b/scripts/create_genesis/sandbox_commitments @@ -0,0 +1,108 @@ +# This file gives the commitments and the seeds used for parametrizing +# protocol alpha. This has been generated by the 'create_genesis.py' +# python script using the blind 'abc' as argument. + + +# Commitments + +[ [ "tz1MawerETND6bqJqUe4cVBcDZn6Tiahrr2V", "btz1bRL4X5BWo2Fj4EsBdUwexXqgTf75uf1qa", "23932454669343" ], + [ "tz1X4maqF9tC1Yn4hzg1w5PLdeKm62qHS64V", "btz1SxjV1syBgftgKy721czKi3arVkVwYUFSv", "72954577464032" ], + [ "tz1SWBY7rWMutEuWRziDhC72gTGdo29KZaRj", "btz1LtoNCjiW23txBTenALaf5H6NKF1L3c1gw", "217487035428348" ], + [ "tz1amUjiZaevaxQy5w26LSf64bs77eNTJ8uY", "btz1SUd3mMhEBcWudrn8u361MVAec4WYCcFoy", "4092742372031" ], + [ "tz1Zaee3QBtD4ErY1CpjigTYtX3VxWB6Ft9a", "btz1MvBXf4orko1tsGmzkjLbpYSgnwUjEe81r", "17590039016550" ], + [ "tz1geDUUhfXK1EMj7LZdP9wfcoAxR3q2QExR", "btz1LoDZ3zsjgG3k3cqTpUMc9bsXbchu9qMXT", "26322312350555" ], + [ "tz1h3nY7jcZciJgAvgNvzgTnjuejEyiEqFGQ", "btz1RMfq456hFV5AeDiZcQuZhoMv2dMpb9hpP", "244951387881443" ], + [ "tz1VzL4Xrb3fL3ckuPqw8u4H7feMAkF4cesJ", "btz1Y9roTh4A7PsMBkp8AgdVFrqUDNaBE59y1", "80065050465525" ], + [ "tz1RUHg536oRKhPLFHi9hit3MKbve91jWjPC", "btz1Q1N2ePwhVw5ED3aaRVek6EBzYs1GDkSVD", "3569618927693" ], + [ "tz1M1LFbgctcPWxstKs21wgvSYBLUpaRwdx8", "btz1VFFVsVMYHd5WfaDTAt92BeQYGK8Ri4eLy", "9034781424478" ] +] + +# In order to test a contract activation in the sandbox node/client, +# one can copy one of the following seeds, store it into a json file +# and pass it to the approriate command (e.g. tezos-client claim +# commitment with ) + +# Associated secret seeds + +[ + { + "mnemonic": ["envelope", "hospital", "mind", "sunset", "cancel", "muscle", "leisure", "thumb", "wine", "market", "exit", "lucky", "style", "picnic", "success"], + "secret": "0f39ed0b656509c2ecec4771712d9cddefe2afac", + "amount": "23932454669343", + "pkh": "tz1MawerETND6bqJqx8GV3YHUrvMBCDasRBF", + "password": "z0eZHQQGKt", + "email": "cjgfoqmk.wpxnvnup@tezos.example.org" + }, + { + "mnemonic": ["flag", "quote", "will", "valley", "mouse", "chat", "hold", "prosper", "silk", "tent", "cruel", "cause", "demise", "bottom", "practice"], + "secret": "41f98b15efc63fa893d61d7d6eee4a2ce9427ac4", + "amount": "72954577464032", + "pkh": "tz1X4maqF9tC1Yn4jULjHRAyzjAtc25Z68TX", + "password": "MHErskWPE6", + "email": "oklmcktr.ztljnpzc@tezos.example.org" + }, + { + "mnemonic": ["library", "away", "inside", "paper", "wise", "focus", "sweet", "expose", "require", "change", "stove", "planet", "zone", "reflect", "finger"], + "secret": "411dfef031eeecc506de71c9df9f8e44297cf5ba", + "amount": "217487035428349", + "pkh": "tz1SWBY7rWMutEuWS54Pt33MkzAS6eWkUuTc", + "password": "0AO6BzQNfN", + "email": "ctgnkvqm.kvtiybky@tezos.example.org" + }, + { + "mnemonic": ["cruel", "fluid", "damage", "demand", "mimic", "above", "village", "alpha", "vendor", "staff", "absent", "uniform", "fire", "asthma", "milk"], + "secret": "08d7d355bc3391d12d140780b39717d9f46fcf87", + "amount": "4092742372031", + "pkh": "tz1amUjiZaevaxQy5wKn4SSRvVoERCip3nZS", + "password": "9kbZ7fR6im", + "email": "bnyxxzqr.tdszcvqb@tezos.example.org" + }, + { + "mnemonic": ["opera", "divorce", "easy", "myself", "idea", "aim", "dash", "scout", "case", "resource", "vote", "humor", "ticket", "client", "edge"], + "secret": "9b7cad042fba557618bdc4b62837c5f125b50e56", + "amount": "17590039016550", + "pkh": "tz1Zaee3QBtD4ErY1SzqUvyYTrENrExu6yQM", + "password": "suxT5H09yY", + "email": "iilkhohu.otnyuvna@tezos.example.org" + }, + { + "mnemonic": ["token", "similar", "ginger", "tongue", "gun", "sort", "piano", "month", "hotel", "vote", "undo", "success", "hobby", "shell", "cart"], + "secret": "124c0ca217f11ffc6c7b76a743d867c8932e5afd", + "amount": "26322312350555", + "pkh": "tz1geDUUhfXK1EMj7VQdRjug1MoFe6gHWnCU", + "password": "4odVdLykaa", + "email": "kwhlglvr.slriitzy@tezos.example.org" + }, + { + "mnemonic": ["shield", "warrior", "gorilla", "birth", "steak", "neither", "feel", "only", "liberty", "float", "oven", "extend", "pulse", "suffer", "vapor"], + "secret": "ac7a2125beea68caf5266a647f24dce9fea018a7", + "amount": "244951387881443", + "pkh": "tz1h3nY7jcZciJgAwRhWcrEwqfVp7VQoffur", + "password": "A6yeMqBFG8", + "email": "lvrmlbyj.yczltcxn@tezos.example.org" + }, + { + "mnemonic": ["waste", "open", "scan", "tip", "subway", "dance", "rent", "copper", "garlic", "laundry", "defense", "clerk", "another", "staff", "liar"], + "secret": "2b3e94be133a960fa0ef87f6c0922c19f9d87ca2", + "amount": "80065050465525", + "pkh": "tz1VzL4Xrb3fL3ckvqCWy6bdGMzU2w9eoRqs", + "password": "oVZqpq60sk", + "email": "rfodmrha.zzdndvyk@tezos.example.org" + }, + { + "mnemonic": ["fiber", "next", "property", "cradle", "silk", "obey", "gossip", "push", "key", "second", "across", "minimum", "nice", "boil", "age"], + "secret": "dac31640199f2babc157aadc0021cd71128ca9ea", + "amount": "3569618927693", + "pkh": "tz1RUHg536oRKhPLFfttcB5gSWAhh4E9TWjX", + "password": "FfytQTTVbu", + "email": "owecikdy.gxnyttya@tezos.example.org" + }, + { + "mnemonic": ["print", "labor", "budget", "speak", "poem", "diet", "chunk", "eternal", "book", "saddle", "pioneer", "ankle", "happy", "only", "exclude"], + "secret": "bb841227f250a066eb8429e56937ad504d7b34dd", + "amount": "9034781424478", + "pkh": "tz1M1LFbgctcPWxstrao9aLr2ECW1fV4pH5u", + "password": "zknAl3lrX2", + "email": "ettilrvh.zsrqrbud@tezos.example.org" + } +] diff --git a/scripts/protocol_parameters.json b/scripts/protocol_parameters.json index 92ba62c31..091a7efca 100644 --- a/scripts/protocol_parameters.json +++ b/scripts/protocol_parameters.json @@ -5,18 +5,6 @@ [ "edpkuFrRoDSEbJYgxRtLx2ps82UdaYc1WwfS9sE11yhauZt5DgCHbU", "4000000000000" ], [ "edpkv8EUUH68jmo3f7Um5PezmfGrRF24gnfLpH3sVNwJnV5bVCxL2n", "4000000000000" ] ], - "commitments": [ - [ "tz1fkmDXEQdua3u71JBVh4eGUGqK4t1G8xhZ", "btz1T77Ly5U1bWNBR5KzDSgNFST5Bh5F1eB6g", "1868898542104130027" ], - [ "tz1doNkK6RKaRswsuKJV4erT6HauYSm9fuHi", "btz1QxTPgszARgWioEor3eMehxW3osfhw3KoJ", "517697389496079974" ], - [ "tz1g6zFsci4YR8p1MJrkyc6wAKizR6mqJmyQ", "btz1NUYc1tV5VBksMNuQG4AuZF9Xudh1sDJni", "962290491831710023" ], - [ "tz1MpbcwGFWVBBWoxwm6iQH5Hzh9mCXbnETJ", "btz1Wwifd8vbQqnbuzSbQLvJEjQ9FUoxVJm68", "1233665184704419921" ], - [ "tz1U4t2PmX5cZVUui4BNaiRVokLa6AxB5G9Z", "btz1RrFkp9GmnypoNGRSyURkBQNUs4PPYG8SR", "131959324067470008" ], - [ "tz1RUxPjviua4XJM78XjSKGUCAS9R3y8Bdof", "btz1hozabzP9HdRakJddzyea7DgPHzJ5PB37N", "112378240876120002" ], - [ "tz1fJPeueQKJrTj2SFV2PmyCinLYJKXCEMf4", "btz1j1k4nrZB4r8RpTYiy8zbi3Fappopkb8ZF", "1060667014046690017" ], - [ "tz1iDPZLxcGf5CqCNpTuuMdtu3zKpJ6HvvFR", "btz1TaSfoSNhFoqwqbPC9iC19rN24KJtB7skD", "71300478465380003" ], - [ "tz1i2kbtVu65dP739qLGRpJNujRM8pdpkH3p", "btz1USqQRuvASPXwseXkGTWeWv4dn3VwMVPEk", "283380756728119992" ], - [ "tz1LKGCg6ESJLDviHkT8Jc7tUwjw4h3d9MaF", "btz1YwCKMbBLRL1qkBjAHGCwjbWDqiTAEFpbw", "1357762577679880028" ] - ], "dictator_pubkey": "edpkuSLWfVU1Vq7Jg9FucPyKmma6otcMHac9zG4oU1KMHSTBpJuGQ2", "time_between_blocks" : [ 1, 0 ], diff --git a/src/bin_client/test/protocol_parameters.json b/src/bin_client/test/protocol_parameters.json index cdd9f6b79..d8b005da6 100644 --- a/src/bin_client/test/protocol_parameters.json +++ b/src/bin_client/test/protocol_parameters.json @@ -6,18 +6,17 @@ [ "edpkuFrRoDSEbJYgxRtLx2ps82UdaYc1WwfS9sE11yhauZt5DgCHbU", "4000000000000" ], [ "edpkv8EUUH68jmo3f7Um5PezmfGrRF24gnfLpH3sVNwJnV5bVCxL2n", "4000000000000" ] ], - "commitments": - [ - [ "tz1fkmDXEQdua3u71JBVh4eGUGqK4t1G8xhZ", "btz1T77Ly5U1bWNBR5KzDSgNFST5Bh5F1eB6g", "1868898542104130027" ], - [ "tz1doNkK6RKaRswsuKJV4erT6HauYSm9fuHi", "btz1QxTPgszARgWioEor3eMehxW3osfhw3KoJ", "517697389496079974" ], - [ "tz1g6zFsci4YR8p1MJrkyc6wAKizR6mqJmyQ", "btz1NUYc1tV5VBksMNuQG4AuZF9Xudh1sDJni", "962290491831710023" ], - [ "tz1MpbcwGFWVBBWoxwm6iQH5Hzh9mCXbnETJ", "btz1Wwifd8vbQqnbuzSbQLvJEjQ9FUoxVJm68", "1233665184704419921" ], - [ "tz1U4t2PmX5cZVUui4BNaiRVokLa6AxB5G9Z", "btz1RrFkp9GmnypoNGRSyURkBQNUs4PPYG8SR", "131959324067470008" ], - [ "tz1RUxPjviua4XJM78XjSKGUCAS9R3y8Bdof", "btz1hozabzP9HdRakJddzyea7DgPHzJ5PB37N", "112378240876120002" ], - [ "tz1fJPeueQKJrTj2SFV2PmyCinLYJKXCEMf4", "btz1j1k4nrZB4r8RpTYiy8zbi3Fappopkb8ZF", "1060667014046690017" ], - [ "tz1iDPZLxcGf5CqCNpTuuMdtu3zKpJ6HvvFR", "btz1TaSfoSNhFoqwqbPC9iC19rN24KJtB7skD", "71300478465380003" ], - [ "tz1i2kbtVu65dP739qLGRpJNujRM8pdpkH3p", "btz1USqQRuvASPXwseXkGTWeWv4dn3VwMVPEk", "283380756728119992" ], - [ "tz1LKGCg6ESJLDviHkT8Jc7tUwjw4h3d9MaF", "btz1YwCKMbBLRL1qkBjAHGCwjbWDqiTAEFpbw", "1357762577679880028" ] + "commitments": [ + [ "tz1MawerETND6bqJqUe4cVBcDZn6Tiahrr2V", "btz1bRL4X5BWo2Fj4EsBdUwexXqgTf75uf1qa", "23932454669343" ], + [ "tz1X4maqF9tC1Yn4hzg1w5PLdeKm62qHS64V", "btz1SxjV1syBgftgKy721czKi3arVkVwYUFSv", "72954577464032" ], + [ "tz1SWBY7rWMutEuWRziDhC72gTGdo29KZaRj", "btz1LtoNCjiW23txBTenALaf5H6NKF1L3c1gw", "217487035428348" ], + [ "tz1amUjiZaevaxQy5w26LSf64bs77eNTJ8uY", "btz1SUd3mMhEBcWudrn8u361MVAec4WYCcFoy", "4092742372031" ], + [ "tz1Zaee3QBtD4ErY1CpjigTYtX3VxWB6Ft9a", "btz1MvBXf4orko1tsGmzkjLbpYSgnwUjEe81r", "17590039016550" ], + [ "tz1geDUUhfXK1EMj7LZdP9wfcoAxR3q2QExR", "btz1LoDZ3zsjgG3k3cqTpUMc9bsXbchu9qMXT", "26322312350555" ], + [ "tz1h3nY7jcZciJgAvgNvzgTnjuejEyiEqFGQ", "btz1RMfq456hFV5AeDiZcQuZhoMv2dMpb9hpP", "244951387881443" ], + [ "tz1VzL4Xrb3fL3ckuPqw8u4H7feMAkF4cesJ", "btz1Y9roTh4A7PsMBkp8AgdVFrqUDNaBE59y1", "80065050465525" ], + [ "tz1RUHg536oRKhPLFHi9hit3MKbve91jWjPC", "btz1Q1N2ePwhVw5ED3aaRVek6EBzYs1GDkSVD", "3569618927693" ], + [ "tz1M1LFbgctcPWxstKs21wgvSYBLUpaRwdx8", "btz1VFFVsVMYHd5WfaDTAt92BeQYGK8Ri4eLy", "9034781424478" ] ], "dictator_pubkey": "edpkuSLWfVU1Vq7Jg9FucPyKmma6otcMHac9zG4oU1KMHSTBpJuGQ2", diff --git a/src/proto_alpha/lib_baking/test/proto_alpha_helpers.ml b/src/proto_alpha/lib_baking/test/proto_alpha_helpers.ml index cf9ccb9d2..0029e0550 100644 --- a/src/proto_alpha/lib_baking/test/proto_alpha_helpers.ml +++ b/src/proto_alpha/lib_baking/test/proto_alpha_helpers.ml @@ -64,16 +64,16 @@ let protocol_parameters = [ "edpkv8EUUH68jmo3f7Um5PezmfGrRF24gnfLpH3sVNwJnV5bVCxL2n", "4000000000000" ] ], "commitments": [ - [ "tz1fkmDXEQdua3u71JBVh4eGUGqK4t1G8xhZ", "btz1T77Ly5U1bWNBR5KzDSgNFST5Bh5F1eB6g", "1868898542104130027" ], - [ "tz1doNkK6RKaRswsuKJV4erT6HauYSm9fuHi", "btz1QxTPgszARgWioEor3eMehxW3osfhw3KoJ", "517697389496079974" ], - [ "tz1g6zFsci4YR8p1MJrkyc6wAKizR6mqJmyQ", "btz1NUYc1tV5VBksMNuQG4AuZF9Xudh1sDJni", "962290491831710023" ], - [ "tz1MpbcwGFWVBBWoxwm6iQH5Hzh9mCXbnETJ", "btz1Wwifd8vbQqnbuzSbQLvJEjQ9FUoxVJm68", "1233665184704419921" ], - [ "tz1U4t2PmX5cZVUui4BNaiRVokLa6AxB5G9Z", "btz1RrFkp9GmnypoNGRSyURkBQNUs4PPYG8SR", "131959324067470008" ], - [ "tz1RUxPjviua4XJM78XjSKGUCAS9R3y8Bdof", "btz1hozabzP9HdRakJddzyea7DgPHzJ5PB37N", "112378240876120002" ], - [ "tz1fJPeueQKJrTj2SFV2PmyCinLYJKXCEMf4", "btz1j1k4nrZB4r8RpTYiy8zbi3Fappopkb8ZF", "1060667014046690017" ], - [ "tz1iDPZLxcGf5CqCNpTuuMdtu3zKpJ6HvvFR", "btz1TaSfoSNhFoqwqbPC9iC19rN24KJtB7skD", "71300478465380003" ], - [ "tz1i2kbtVu65dP739qLGRpJNujRM8pdpkH3p", "btz1USqQRuvASPXwseXkGTWeWv4dn3VwMVPEk", "283380756728119992" ], - [ "tz1LKGCg6ESJLDviHkT8Jc7tUwjw4h3d9MaF", "btz1YwCKMbBLRL1qkBjAHGCwjbWDqiTAEFpbw", "1357762577679880028" ] + [ "tz1MawerETND6bqJqUe4cVBcDZn6Tiahrr2V", "btz1bRL4X5BWo2Fj4EsBdUwexXqgTf75uf1qa", "23932454669343" ], + [ "tz1X4maqF9tC1Yn4hzg1w5PLdeKm62qHS64V", "btz1SxjV1syBgftgKy721czKi3arVkVwYUFSv", "72954577464032" ], + [ "tz1SWBY7rWMutEuWRziDhC72gTGdo29KZaRj", "btz1LtoNCjiW23txBTenALaf5H6NKF1L3c1gw", "217487035428348" ], + [ "tz1amUjiZaevaxQy5w26LSf64bs77eNTJ8uY", "btz1SUd3mMhEBcWudrn8u361MVAec4WYCcFoy", "4092742372031" ], + [ "tz1Zaee3QBtD4ErY1CpjigTYtX3VxWB6Ft9a", "btz1MvBXf4orko1tsGmzkjLbpYSgnwUjEe81r", "17590039016550" ], + [ "tz1geDUUhfXK1EMj7LZdP9wfcoAxR3q2QExR", "btz1LoDZ3zsjgG3k3cqTpUMc9bsXbchu9qMXT", "26322312350555" ], + [ "tz1h3nY7jcZciJgAvgNvzgTnjuejEyiEqFGQ", "btz1RMfq456hFV5AeDiZcQuZhoMv2dMpb9hpP", "244951387881443" ], + [ "tz1VzL4Xrb3fL3ckuPqw8u4H7feMAkF4cesJ", "btz1Y9roTh4A7PsMBkp8AgdVFrqUDNaBE59y1", "80065050465525" ], + [ "tz1RUHg536oRKhPLFHi9hit3MKbve91jWjPC", "btz1Q1N2ePwhVw5ED3aaRVek6EBzYs1GDkSVD", "3569618927693" ], + [ "tz1M1LFbgctcPWxstKs21wgvSYBLUpaRwdx8", "btz1VFFVsVMYHd5WfaDTAt92BeQYGK8Ri4eLy", "9034781424478" ] ], "time_between_blocks" : [ 1, 0 ], "blocks_per_cycle" : 4, diff --git a/src/proto_alpha/lib_protocol/test/helpers/helpers_init.ml b/src/proto_alpha/lib_protocol/test/helpers/helpers_init.ml index 350dae552..23c3a0c4a 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/helpers_init.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/helpers_init.ml @@ -32,16 +32,16 @@ let protocol_parameters = [ "edpkv8EUUH68jmo3f7Um5PezmfGrRF24gnfLpH3sVNwJnV5bVCxL2n", "4000000000000" ] ], "commitments": [ - [ "tz1fkmDXEQdua3u71JBVh4eGUGqK4t1G8xhZ", "btz1T77Ly5U1bWNBR5KzDSgNFST5Bh5F1eB6g", "1868898542104130027" ], - [ "tz1doNkK6RKaRswsuKJV4erT6HauYSm9fuHi", "btz1QxTPgszARgWioEor3eMehxW3osfhw3KoJ", "517697389496079974" ], - [ "tz1g6zFsci4YR8p1MJrkyc6wAKizR6mqJmyQ", "btz1NUYc1tV5VBksMNuQG4AuZF9Xudh1sDJni", "962290491831710023" ], - [ "tz1MpbcwGFWVBBWoxwm6iQH5Hzh9mCXbnETJ", "btz1Wwifd8vbQqnbuzSbQLvJEjQ9FUoxVJm68", "1233665184704419921" ], - [ "tz1U4t2PmX5cZVUui4BNaiRVokLa6AxB5G9Z", "btz1RrFkp9GmnypoNGRSyURkBQNUs4PPYG8SR", "131959324067470008" ], - [ "tz1RUxPjviua4XJM78XjSKGUCAS9R3y8Bdof", "btz1hozabzP9HdRakJddzyea7DgPHzJ5PB37N", "112378240876120002" ], - [ "tz1fJPeueQKJrTj2SFV2PmyCinLYJKXCEMf4", "btz1j1k4nrZB4r8RpTYiy8zbi3Fappopkb8ZF", "1060667014046690017" ], - [ "tz1iDPZLxcGf5CqCNpTuuMdtu3zKpJ6HvvFR", "btz1TaSfoSNhFoqwqbPC9iC19rN24KJtB7skD", "71300478465380003" ], - [ "tz1i2kbtVu65dP739qLGRpJNujRM8pdpkH3p", "btz1USqQRuvASPXwseXkGTWeWv4dn3VwMVPEk", "283380756728119992" ], - [ "tz1LKGCg6ESJLDviHkT8Jc7tUwjw4h3d9MaF", "btz1YwCKMbBLRL1qkBjAHGCwjbWDqiTAEFpbw", "1357762577679880028" ] + [ "tz1MawerETND6bqJqUe4cVBcDZn6Tiahrr2V", "btz1bRL4X5BWo2Fj4EsBdUwexXqgTf75uf1qa", "23932454669343" ], + [ "tz1X4maqF9tC1Yn4hzg1w5PLdeKm62qHS64V", "btz1SxjV1syBgftgKy721czKi3arVkVwYUFSv", "72954577464032" ], + [ "tz1SWBY7rWMutEuWRziDhC72gTGdo29KZaRj", "btz1LtoNCjiW23txBTenALaf5H6NKF1L3c1gw", "217487035428348" ], + [ "tz1amUjiZaevaxQy5w26LSf64bs77eNTJ8uY", "btz1SUd3mMhEBcWudrn8u361MVAec4WYCcFoy", "4092742372031" ], + [ "tz1Zaee3QBtD4ErY1CpjigTYtX3VxWB6Ft9a", "btz1MvBXf4orko1tsGmzkjLbpYSgnwUjEe81r", "17590039016550" ], + [ "tz1geDUUhfXK1EMj7LZdP9wfcoAxR3q2QExR", "btz1LoDZ3zsjgG3k3cqTpUMc9bsXbchu9qMXT", "26322312350555" ], + [ "tz1h3nY7jcZciJgAvgNvzgTnjuejEyiEqFGQ", "btz1RMfq456hFV5AeDiZcQuZhoMv2dMpb9hpP", "244951387881443" ], + [ "tz1VzL4Xrb3fL3ckuPqw8u4H7feMAkF4cesJ", "btz1Y9roTh4A7PsMBkp8AgdVFrqUDNaBE59y1", "80065050465525" ], + [ "tz1RUHg536oRKhPLFHi9hit3MKbve91jWjPC", "btz1Q1N2ePwhVw5ED3aaRVek6EBzYs1GDkSVD", "3569618927693" ], + [ "tz1M1LFbgctcPWxstKs21wgvSYBLUpaRwdx8", "btz1VFFVsVMYHd5WfaDTAt92BeQYGK8Ri4eLy", "9034781424478" ] ], "time_between_blocks" : [ 1, 0 ], "blocks_per_cycle" : 4, diff --git a/src/proto_alpha/lib_protocol/test/test_activation.ml b/src/proto_alpha/lib_protocol/test/test_activation.ml index c21f295f4..6c82eeaf5 100644 --- a/src/proto_alpha/lib_protocol/test/test_activation.ml +++ b/src/proto_alpha/lib_protocol/test/test_activation.ml @@ -17,25 +17,9 @@ exception No_error open Isolate_helpers - -(* Generated commitment with secret included in commitment storage : - - (blind = "abc") - - pk = edpktiPG79C8CRTMxua67NEaVKH7AydAMWRiC5KHQv78Ckx4UrZYBy - pkh = tz1fkmDXEQdua3u71vstaKwR4h8KY7oT1PDF - amount = 1868898542104.130027 - - secret = 0xc5422e3864b9e6c5260e2aac76ea0f3d28d4fff7 - - half_pkh = 0xdca88243fece75e9c22e - blinded_pkh : 0x4a6af2f5c466bf0a7a1001a1e9468cbfca82cef6 - -*) - let pk = Ed25519.Public_key.of_b58check_exn - "edpktiPG79C8CRTMxua67NEaVKH7AydAMWRiC5KHQv78Ckx4UrZYBy" + "edpkuSR6ywqsk17myFVRcw2eXhVib2MeLc9D1QkEQb98ctWUBwSJpF" let pkh = Ed25519.Public_key.hash pk let half_pkh = let len = Ed25519.Public_key_hash.size / 2 in @@ -43,14 +27,14 @@ let half_pkh = let given_secret = Blinded_public_key_hash.secret_of_hex - "c5422e3864b9e6c5260e2aac76ea0f3d28d4fff7" + "0f39ed0b656509c2ecec4771712d9cddefe2afac" let expected_blinded_pkh = Blinded_public_key_hash.of_b58check_exn - "btz1T77Ly5U1bWNBR5KzDSgNFST5Bh5F1eB6g" + "btz1bRL4X5BWo2Fj4EsBdUwexXqgTf75uf1qa" let expected_amount = - match Tez.of_mutez 1868898542104130027L with + match Tez.of_mutez 23932454669343L with | Some s -> s | _ -> assert false