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

前两天310个比特币藏宝图火了,今天早上看到币早公众号的比特币夺宝题就做了下。藏宝图中共藏有1个比特币私钥(WIF私钥),和两个以太坊私钥。

以太坊第一题解法:

观察 可以看到第二行第三行最后8位重复,去掉一次重复前三行字符长度位64,eth非压缩格式私钥包括补零的话长度为65字节。

#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

取第三个通过etherscan查询余额,或者直接拿私钥导入myethwallet成功

https://etherscan.io/address/0xd3d88a366b4b14c7af7f5fb239911ba5dd8a0d6f
从ethscan可以看到昨天就被解开了 -

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