Exemplo n.º 1
0
def importMM(wordlist):
    print("for testing purposes only!")
    sk = MiniNero.recoverSK(wordlist)
    print("vk", vk)
    print("pvk", MiniNero.publicFromSecret(vk))
    key = mnemonic.mn_encode(sk)
    cks = MiniNero.electrumChecksum(key)
    print(key + " "+cks)
Exemplo n.º 2
0
def importMM(wordlist):
    print("for testing purposes only!")
    sk = MiniNero.recoverSK(wordlist)
    print("vk", vk)
    print("pvk", MiniNero.publicFromSecret(vk))
    key = mnemonic.mn_encode(sk)
    cks = MiniNero.electrumChecksum(key)
    print(key + " "+cks)
Exemplo n.º 3
0
def deterministicVK():
    while True:
        print('.'),
        tmp = MiniNero.intToHex(rand.getrandbits(64 *
                                                 8))  # 8 bits to a byte ...
        sk = MiniNero.sc_reduce_key(MiniNero.cn_fast_hash(tmp))

        #s = "3c817618dcbfed122a64e592bb441d73300da9123686224a84e0eab1f075117e"; for testing
        #sk = MiniNero.sc_reduce_key(s)
        vk = MiniNero.getViewMM(sk)  #note this is the sc_reduced version..
        worked = 1
        try:
            MiniNero.toPoint(vk)
        except:
            worked = 0
            print("bad vk")
        if vk == MiniNero.sc_reduce_key(
                vk) and worked == 1:  #already reduced + vk on curve
            break

    print("found keys")
    print("secret spend key:", sk)
    print("secret view key:", vk)
    vk2 = MiniNero.cn_fast_hash(MiniNero.scalarmultKey(vk, 2))
    print("secret view key2:", vk2)
    vk3 = MiniNero.cn_fast_hash(MiniNero.scalarmultKey(vk, 3))
    print("secret view key3:", vk3)

    pk = MiniNero.publicFromSecret(sk)
    print("public spend key:", pk)
    pvk = MiniNero.publicFromSecret(vk)
    print("public view key:", pvk)
    pvk2 = MiniNero.publicFromSecret(vk2)
    print("public view key2:", pvk2)
    pvk3 = MiniNero.publicFromSecret(vk3)
    print("public view key3:", pvk3)

    addr = MiniNero.getAddrMM(sk)
    print("in future this will get all addresses")
    print("receiving address", addr)
    wl = mnemonic.mn_encode(s)
    cks = MiniNero.electrumChecksum(wl)
    print(cks)
    print("mnemonic:", wl + " " + cks)
Exemplo n.º 4
0
def moneroProofOfFile(fi):
    s = cnHashOfFile(fi)
    #s = MiniNero.sc_reduce_key(s) #if you are testing, insert
    #an s below this line

    sk = MiniNero.sc_reduce_key(s)
    print("secret spend key:", sk)
    vk = MiniNero.getView(sk)
    print("secret view key:", vk)
    pk = MiniNero.publicFromSecret(sk)
    print("public spend key:", pk)
    pvk = MiniNero.publicFromSecret(vk)
    print("public view key:", pvk)
    wl = mnemonic.mn_encode(s)
    cks = MiniNero.electrumChecksum(wl)
    print(cks)
    print("mnemonic:", wl + " " + cks)

    return MiniNero.encode_addr(MiniNero.netVersion(), pk, pvk)
Exemplo n.º 5
0
def deterministicVK():
    while True:
        print("."),
        tmp = MiniNero.intToHex(rand.getrandbits(64 * 8))  # 8 bits to a byte ...
        sk = MiniNero.sc_reduce_key(MiniNero.cn_fast_hash(tmp))

        # s = "3c817618dcbfed122a64e592bb441d73300da9123686224a84e0eab1f075117e"; for testing
        # sk = MiniNero.sc_reduce_key(s)
        vk = MiniNero.getViewMM(sk)  # note this is the sc_reduced version..
        worked = 1
        try:
            MiniNero.toPoint(vk)
        except:
            worked = 0
            print("bad vk")
        if vk == MiniNero.sc_reduce_key(vk) and worked == 1:  # already reduced + vk on curve
            break

    print("found keys")
    print("secret spend key:", sk)
    print("secret view key:", vk)
    vk2 = MiniNero.cn_fast_hash(MiniNero.scalarmultKey(vk, 2))
    print("secret view key2:", vk2)
    vk3 = MiniNero.cn_fast_hash(MiniNero.scalarmultKey(vk, 3))
    print("secret view key3:", vk3)

    pk = MiniNero.publicFromSecret(sk)
    print("public spend key:", pk)
    pvk = MiniNero.publicFromSecret(vk)
    print("public view key:", pvk)
    pvk2 = MiniNero.publicFromSecret(vk2)
    print("public view key2:", pvk2)
    pvk3 = MiniNero.publicFromSecret(vk3)
    print("public view key3:", pvk3)

    addr = MiniNero.getAddrMM(sk)
    print("in future this will get all addresses")
    print("receiving address", addr)
    wl = mnemonic.mn_encode(s)
    cks = MiniNero.electrumChecksum(wl)
    print(cks)
    print("mnemonic:", wl + " " + cks)
Exemplo n.º 6
0
def keysBoth():
    print("This is for private testing purposes only, use at your own risk!")
    print(
        "this function will generate an address that is compatible both with the main client and with MyByteRub"
    )
    print("shen noether- mrl")
    print(" ")
    while True:
        print('.'),
        sk = skGen()

        #s = "3c817618dcbfed122a64e592bb441d73300da9123686224a84e0eab1f075117e"; for testing

        vk = MiniNero.getViewMM(sk)  #note this is the sc_reduced version..
        worked = 1
        #uncomment below lines to make viewkey a point..
        try:
            MiniNero.toPoint(vk)
        except:
            worked = 0
            print("bad vk")

        if vk == MiniNero.sc_reduce_key(vk) and worked == 1:  #already reduced
            break
    print("found key")
    print("secret spend key:", sk)
    print("secret view key:", vk)
    pk = MiniNero.publicFromSecret(sk)
    print("public spend key:", pk)
    pvk = MiniNero.publicFromSecret(vk)
    print("public view key:", pvk)
    addr = MiniNero.getAddrMM(sk)
    print("receiving address", addr)
    wl = mnemonic.mn_encode(sk)
    cks = MiniNero.electrumChecksum(wl)
    print(cks)
    print("mnemonic:", wl + " " + cks)
    return sk, vk, pk, pvk, addr, wl, cks
Exemplo n.º 7
0
def keysBoth():
    print("This is for private testing purposes only, use at your own risk!")
    print("this function will generate an address that is compatible both with the main client and with MyMonero")
    print("shen noether- mrl")
    print(" ")
    while True:
        print('.'),
        sk = skGen()

        #s = "3c817618dcbfed122a64e592bb441d73300da9123686224a84e0eab1f075117e"; for testing

        vk = MiniNero.getViewMM(sk) #note this is the sc_reduced version..
        worked = 1
        #uncomment below lines to make viewkey a point..
        try:
            MiniNero.toPoint(vk)
        except:
            worked =0
            print("bad vk")

        if vk == MiniNero.sc_reduce_key(vk) and worked == 1: #already reduced
            break
    print("found key")
    print("secret spend key:", sk)
    print("secret view key:", vk)
    pk = MiniNero.publicFromSecret(sk)
    print("public spend key:", pk)
    pvk = MiniNero.publicFromSecret(vk)
    print("public view key:", pvk)
    addr =  MiniNero.getAddrMM(sk)
    print("receiving address", addr)
    wl = mnemonic.mn_encode(sk)
    cks = MiniNero.electrumChecksum(wl)
    print(cks)
    print("mnemonic:", wl + " " + cks)
    return sk, vk, pk, pvk, addr, wl, cks
Exemplo n.º 8
0
#you += hash(pubkey || index) to both the private scalar and public point
#<tacotime> [02:35:38] so to get priv_i and pub_i
#<tacotime> [02:36:06] priv_i = (priv + hash) mod N
#<tacotime> [02:37:17] pub_i = (pub + scalarbasemult(hash))
import MiniNero
import PaperWallet

sk, vk, pk, pvk, addr, wl, cks = PaperWallet.keysBoth()

print("making keychain")
for i in range(1, 600):
    index = MiniNero.intToHex(i)
    has = MiniNero.cn_fast_hash(pk + index)
    sk1 = MiniNero.sc_add_keys(sk, has)
    pk1 = MiniNero.addKeys(pk, MiniNero.scalarmultBase(has))
    pk1_check =  MiniNero.publicFromSecret(sk1)
    print("Check", pk1== pk1_check)
    print(sk1)
    #print("i, sk, pk", i, sk1, pk1)
Exemplo n.º 9
0
     seed = "unzip festival cease fences value anchor waking tomorrow ritual hookup guarded antics cease"
     sk = MiniNero.recoverSK(seed)
     print("sk", sk)
     print("addr my monero", MiniNero.getAddr(sk))
 if sys.argv[1] == "vk":
     #check making viewkey
     sk = "86c5616d91c7e7d96ec8220b15a5d441526ecc09f76347a40ab3a67373f8ba03"
     sk = "7eb3f0d43fbe9caee69215fbc360f49ce545d0dfae71390d531c9723cb25e904"
     vk = MiniNero.getView(sk)
     vk = "bb36fe9e852f617093a1634626268b61c5e5e065f503cbdd105877a0a54c3a02"
     print(vk)
 if sys.argv[1] == "addr":
     sk = "b6aafbbb9a6ee768bf292f7ebf977b6a31f51d4ecbf59186dd8367a3012f640f"
     sk = "7eb3f0d43fbe9caee69215fbc360f49ce545d0dfae71390d531c9723cb25e904"
     sk = "7c404922198b99c08020468c896f13df4f6e2ff1b5ab3c528e014cc9836ce80b"
     pk = MiniNero.publicFromSecret(sk)
     print("pk", pk)
     vk = "9e71628d6db09405a1267550b902299ed5cd004653e52d0a12129a21ab69900d"
     vk = "bb36fe9e852f617093a1634626268b61c5e5e065f503cbdd105877a0a54c3a02"
     vk = "7c404922198b99c08020468c896f13df4f6e2ff1b5ab3c528e014cc9836ce80b"
     vk = "c1c9e45989cc5fbfe828400886c50b4f58da40692d0f6ce6b3d483c4f1bf4b05"
     pvk = MiniNero.publicFromSecret(vk)
     print("pvk", pvk)
     vers = "12"
     print(MiniNero.encode_addr(vers, pk, pvk))
 if sys.argv[1] == "sp":
     a = "9d61b19deffd5a60ba844af492ec2cc44449c5697b326919703bac031cae7f60"
     a = "c8d603858291b23c42695fec0b3db1b7fcb961e63d885a89c6ef70507a0b3204"
     a = "7c404922198b99c08020468c896f13df4f6e2ff1b5ab3c528e014cc9836ce80b"
     b = MiniNero.publicFromSecret(a)
     print(b)
Exemplo n.º 10
0
     seed = "unzip festival cease fences value anchor waking tomorrow ritual hookup guarded antics cease"
     sk = MiniNero.recoverSK(seed)
     print("sk", sk)
     print("addr my byterub", MiniNero.getAddr(sk))
 if sys.argv[1] == "vk":
     #check making viewkey
     sk = "86c5616d91c7e7d96ec8220b15a5d441526ecc09f76347a40ab3a67373f8ba03"
     sk = "7eb3f0d43fbe9caee69215fbc360f49ce545d0dfae71390d531c9723cb25e904"
     vk = MiniNero.getView(sk)
     vk = "bb36fe9e852f617093a1634626268b61c5e5e065f503cbdd105877a0a54c3a02"
     print(vk)
 if sys.argv[1] == "addr":
     sk = "b6aafbbb9a6ee768bf292f7ebf977b6a31f51d4ecbf59186dd8367a3012f640f"
     sk = "7eb3f0d43fbe9caee69215fbc360f49ce545d0dfae71390d531c9723cb25e904"
     sk = "7c404922198b99c08020468c896f13df4f6e2ff1b5ab3c528e014cc9836ce80b"
     pk = MiniNero.publicFromSecret(sk)
     print("pk", pk)
     vk = "9e71628d6db09405a1267550b902299ed5cd004653e52d0a12129a21ab69900d"
     vk = "bb36fe9e852f617093a1634626268b61c5e5e065f503cbdd105877a0a54c3a02"
     vk = "7c404922198b99c08020468c896f13df4f6e2ff1b5ab3c528e014cc9836ce80b"
     vk = "c1c9e45989cc5fbfe828400886c50b4f58da40692d0f6ce6b3d483c4f1bf4b05"
     pvk = MiniNero.publicFromSecret(vk)
     print("pvk", pvk)
     vers = "12"
     print(MiniNero.encode_addr(vers, pk, pvk))
 if sys.argv[1] == "sp":
     a = "9d61b19deffd5a60ba844af492ec2cc44449c5697b326919703bac031cae7f60"
     a = "c8d603858291b23c42695fec0b3db1b7fcb961e63d885a89c6ef70507a0b3204"
     a = "7c404922198b99c08020468c896f13df4f6e2ff1b5ab3c528e014cc9836ce80b"
     b = MiniNero.publicFromSecret(a)
     print(b)
Exemplo n.º 11
0
#you += hash(pubkey || index) to both the private scalar and public point
#<tacotime> [02:35:38] so to get priv_i and pub_i
#<tacotime> [02:36:06] priv_i = (priv + hash) mod N
#<tacotime> [02:37:17] pub_i = (pub + scalarbasemult(hash))
import MiniNero
import PaperWallet

sk, vk, pk, pvk, addr, wl, cks = PaperWallet.keysBoth()

print("making keychain")
for i in range(1, 600):
    index = MiniNero.intToHex(i)
    has = MiniNero.cn_fast_hash(pk + index)
    sk1 = MiniNero.sc_add_keys(sk, has)
    pk1 = MiniNero.addKeys(pk, MiniNero.scalarmultBase(has))
    pk1_check = MiniNero.publicFromSecret(sk1)
    print("Check", pk1 == pk1_check)
    print(sk1)
    #print("i, sk, pk", i, sk1, pk1)
Exemplo n.º 12
0
q = 2**255 - 19
l = 2**252 + 27742317777372353535851937790883648493
import MiniNero
import PaperWallet

a = 3655169758690262480859172686034352748701568204867449275194046101565641063400
b = 2196281112309589493539510630657048805544016132079821556435431458072258858680
c = 1680308020000391016811131033972168547846809685867129675902005632340344199616
d = 3102886190919558838979092227453570755967767872654511102581747930112259050736
e = a + b + c + d
print(e, e % l)
pk = MiniNero.publicFromSecret(MiniNero.intToHex(e))
pka = MiniNero.publicFromSecret(MiniNero.intToHex(a))
pkb = MiniNero.publicFromSecret(MiniNero.intToHex(b))
pkc = MiniNero.publicFromSecret(MiniNero.intToHex(c))
pkd = MiniNero.publicFromSecret(MiniNero.intToHex(d))
A = MiniNero.addKeys(pka, pkb)
B = MiniNero.addKeys(A, pkc)
C = MiniNero.addKeys(B, pkd)
print(C)
print(pk)