无密钥也能找回以太坊
有个朋友的以太坊在5年前不小心打入一个自己没有密钥的合约账户,那个时候不值钱。现在价值10几万。问我能不能找回来。我想密钥应该存在他的电脑中,于是恢复了下2016-2018年的密钥数据,发现并没有那个地址的密钥,其他地址的密钥反而恢复了30几个。后来网上搜索大量数据,发现有可能无密钥找回丢失的以太坊。好吧下面开始我是怎么操作的。
第一步:查找随机值nonce,不许下载安装任何程序软件。在https://remix.ethereum.org/直接部署代码
pragma solidity ^0.4.24;
library ContractAddrCalculator {
// NOTE this program works as long as nonce is less than 33 bytes
// which is 2**(8*33), almost impossible for a contract to create
// so many contracts, also uint256 is only 32bytes
// GAS COST
// nonce = 1 => 256
// 0x80 => 389
// 0x0102 => 429
// above is example of assembly execution cost, plus 280 other execution cost per tx
// complaint: 1. the compiler's control flow analysis sucks
// 2. no opcode for left/right shift, has to use a combination of exp and mul, causes a lot more gas usage
fun