# 币早知道夺宝题--以太坊题解题方法

#### 以太坊第一题解法：

#e0ce9b41a26cc9b8e4256536
#4ae13af57c39a135d8d909fe
#c77855fea228be0cd8d909fe



import itertools
import codecs, ecdsa
import sha3
import requests
import json
import ast
import time

def balance(addr):
url = 'https://api.etherscan.io/api?module=account&action=balance&address=%s&tag=latest&apikey=%s' % (addr, 'xx')
r = requests.get(url)
try:
ba = ast.literal_eval(r.text)['result']
#if ba != '0':
print addr, '---------',ba
except Exception as e:
print addr
print e

def gen_addr(private_key):
private_key_bytes = codecs.decode(private_key, 'hex')
key = ecdsa.SigningKey.from_string(private_key_bytes, curve=ecdsa.SECP256k1).verifying_key
key_bytes = key.to_string()
key_hex = codecs.encode(key_bytes, 'hex')
public_key_bytes = codecs.decode(key_hex, 'hex')
keccak_hash = sha3.keccak_256()
keccak_hash.update(public_key_bytes)
keccak_digest = keccak_hash.hexdigest()
wallet_len = 40
wallet = '0x'+ keccak_digest[-wallet_len:]
return wallet

for t in  itertools.permutations(l):
if 'd8d909fe' in t:
mystr1 = ''.join(t)
print mystr1
addr = gen_addr(mystr1)
balance(addr)
time.sleep(1)



e0ce9b41a26cc9b8e42565364ae13af57c39a135c77855fea228be0cd8d909fe
e0ce9b41a26cc9b8e42565364ae13af57c39a135d8d909fec77855fea228be0c
e0ce9b41a26cc9b8e4256536c77855fea228be0c4ae13af57c39a135d8d909fe
e0ce9b41a26cc9b8e4256536c77855fea228be0cd8d909fe4ae13af57c39a135
e0ce9b41a26cc9b8e4256536d8d909fe4ae13af57c39a135c77855fea228be0c
e0ce9b41a26cc9b8e4256536d8d909fec77855fea228be0c4ae13af57c39a135
4ae13af57c39a135e0ce9b41a26cc9b8e4256536c77855fea228be0cd8d909fe
4ae13af57c39a135e0ce9b41a26cc9b8e4256536d8d909fec77855fea228be0c
4ae13af57c39a135c77855fea228be0ce0ce9b41a26cc9b8e4256536d8d909fe
4ae13af57c39a135c77855fea228be0cd8d909fee0ce9b41a26cc9b8e4256536
4ae13af57c39a135d8d909fee0ce9b41a26cc9b8e4256536c77855fea228be0c
4ae13af57c39a135d8d909fec77855fea228be0ce0ce9b41a26cc9b8e4256536
c77855fea228be0ce0ce9b41a26cc9b8e42565364ae13af57c39a135d8d909fe
c77855fea228be0ce0ce9b41a26cc9b8e4256536d8d909fe4ae13af57c39a135
c77855fea228be0c4ae13af57c39a135e0ce9b41a26cc9b8e4256536d8d909fe
c77855fea228be0c4ae13af57c39a135d8d909fee0ce9b41a26cc9b8e4256536
c77855fea228be0cd8d909fee0ce9b41a26cc9b8e42565364ae13af57c39a135
c77855fea228be0cd8d909fe4ae13af57c39a135e0ce9b41a26cc9b8e4256536
d8d909fee0ce9b41a26cc9b8e42565364ae13af57c39a135c77855fea228be0c
d8d909fee0ce9b41a26cc9b8e4256536c77855fea228be0c4ae13af57c39a135
d8d909fe4ae13af57c39a135e0ce9b41a26cc9b8e4256536c77855fea228be0c
d8d909fe4ae13af57c39a135c77855fea228be0ce0ce9b41a26cc9b8e4256536
d8d909fec77855fea228be0ce0ce9b41a26cc9b8e42565364ae13af57c39a135
d8d909fec77855fea228be0c4ae13af57c39a135e0ce9b41a26cc9b8e4256536



https://etherscan.io/address/0xd3d88a366b4b14c7af7f5fb239911ba5dd8a0d6f

--- --- --- --- From 小小leo 的博客 --- --- --- ---
posted @ 2018-09-30 13:11  小小leo  阅读(583)  评论(0编辑  收藏  举报