基于geth的以太坊冷钱包方案
发布于 8 个月前 作者 maiiz 32338 次浏览 来自 以太坊

基于官方geth的冷钱包离线方案

1. 运行geth 节点

geth console

2. 构造交易

需要自己填写参数 from, to, value, nonce, gas, gasPrice 其中nonce, gas, gasPrice 可以去https://www.myetherwallet.com/#offline-transaction 获取,也可以通过其它方式

eth.signTransaction({"from":"0xb41dca9f040286681eb996a07d27ea099e95ce29", "to":"0xfb26fe6843ead0ce39fd5fceb9a1c306055efecf", "value":web3.toWei("99"), "nonce":2, "gas":21000, "gasPrice":21000000000})
{
  raw: "0xf86d028504e3b2920082520894fb26fe6843ead0ce39fd5fceb9a1c306055efecf89055de6a779bbac00008076a0107e2fa8373ce379a3056d8e910e7214e8189c1c18e5e87c945e2b26e636749ba01306e8e60c11c809c5288ae05485ce527241cdd6a5f62083fd487a57651b679f",
  tx: {
    gas: "0x5208",
    gasPrice: "0x4e3b29200",
    hash: "0xd50e070d04c321ba6db1bc0206553834cd64884e566e4b38fd600a15d9793f90",
    input: "0x",
    nonce: "0x2",
    r: "0x107e2fa8373ce379a3056d8e910e7214e8189c1c18e5e87c945e2b26e636749b",
    s: "0x1306e8e60c11c809c5288ae05485ce527241cdd6a5f62083fd487a57651b679f",
    to: "0xfb26fe6843ead0ce39fd5fceb9a1c306055efecf",
    v: "0x76",
    value: "0x55de6a779bbac0000"
  }
}

3. 广播

https://etherscan.io/pushTx

3 回复

普通转账gas是个固定值

@路人-戊 21000

回到顶部