当前位置: 首页>>代码示例>>Python>>正文


Python MiniNero.publicFromSecret方法代码示例

本文整理汇总了Python中MiniNero.publicFromSecret方法的典型用法代码示例。如果您正苦于以下问题:Python MiniNero.publicFromSecret方法的具体用法?Python MiniNero.publicFromSecret怎么用?Python MiniNero.publicFromSecret使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MiniNero的用法示例。


在下文中一共展示了MiniNero.publicFromSecret方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: importMM

# 需要导入模块: import MiniNero [as 别名]
# 或者: from MiniNero import publicFromSecret [as 别名]
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)
开发者ID:Coder420,项目名称:MiniNero,代码行数:10,代码来源:MyMoneroImport.py

示例2: moneroProofOfFile

# 需要导入模块: import MiniNero [as 别名]
# 或者: from MiniNero import publicFromSecret [as 别名]
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)
开发者ID:Coder420,项目名称:MiniNero,代码行数:21,代码来源:MoneroProof.py

示例3: deterministicVK

# 需要导入模块: import MiniNero [as 别名]
# 或者: from MiniNero import publicFromSecret [as 别名]
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)
开发者ID:Coder420,项目名称:MiniNero,代码行数:44,代码来源:Deterministic.py

示例4: keysBoth

# 需要导入模块: import MiniNero [as 别名]
# 或者: from MiniNero import publicFromSecret [as 别名]
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
开发者ID:Coder420,项目名称:MiniNero,代码行数:38,代码来源:PaperWallet.py

示例5: hash

# 需要导入模块: import MiniNero [as 别名]
# 或者: from MiniNero import publicFromSecret [as 别名]
#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)
开发者ID:Coder420,项目名称:MiniNero,代码行数:21,代码来源:TactoTimeKeyChains.py

示例6: print

# 需要导入模块: import MiniNero [as 别名]
# 或者: from MiniNero import publicFromSecret [as 别名]
     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)
开发者ID:ShenNoether,项目名称:research-lab,代码行数:33,代码来源:Test.py

示例7: print

# 需要导入模块: import MiniNero [as 别名]
# 或者: from MiniNero import publicFromSecret [as 别名]
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)

开发者ID:Coder420,项目名称:MiniNero,代码行数:23,代码来源:TacoTimeExample.py


注:本文中的MiniNero.publicFromSecret方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。