从命令行开始解析以太坊新建账户过程(geth account new命令)

以太坊编程-Geth Geth安装 阅读详情

从命令行开始解析以太坊新建账户过程(geth account new命令)

account

如上图是生成一个账户的过程,最后的账户表现为一个地址那么,这个过程的代码是怎么实现的呢,接下来我们从main函数命令行开始解析这个过程的代码。

在cmd/geth/main.go中的init函数中,有一个accountCommand的命令行参数

func init() {
  // Initialize the CLI app and start Geth
  app.Action = geth
  app.HideVersion = true // we have a command to print the version
  app.Copyright = "Copyright 2013-2018 The go-ethereum Authors"
  app.Commands = []cli.Command{
    // See chaincmd.go:
    initCommand,
    importCommand,
    exportCommand,
    importPreimagesCommand,
    exportPreimagesCommand,
    copydbCommand,
    removedbCommand,
    dumpCommand,
    // See monitorcmd.go:
    monitorCommand,
    // See accountcmd.go:
    accountCommand,
    walletCommand,
    // See consolecmd.go:
    consoleCommand,
    attachCommand,
    javascriptCommand,
    // See misccmd.go:
    makecacheCommand,
    makedagCommand,
    versionCommand,
    bugCommand,
    licenseCommand,
    // See config.go
    dumpConfigCommand,
  }
  sort.Sort(cli.CommandsByName(app.Commands))

  app.Flags = append(app.Flags, nodeFlags...)
  app.Flags = append(app.Flags, rpcFlags...)
  app.Flags = append(app.Flags, consoleFlags...)
  app.Flags = append(app.Flags, debug.Flags...)
  app.Flags = append(app.Flags, whisperFlags...)

  app.Before = func(ctx *cli.Context) error {
    runtime.GOMAXPROCS(runtime.NumCPU())
    if err := debug.Setup(ctx); err != nil {
      return err
    }
    // Start system runtime metrics collection
    go metrics.CollectProcessMetrics(3 * time.Second)

    utils.SetupNetwork(ctx)
    return nil
  }

  app.After = func(ctx *cli.Context) error {
    debug.Exit()
    console.Stdin.Close() // Resets terminal mode.
    return nil
  }
}

账户相关的命令在cmd/geth/accountcmd.go里,新建账户命令为new,其会调accountCreate方法,我们继续看:

accountCommand = cli.Command{
	Name:     "account",
	Usage:    "Manage accounts",
	Category: "ACCOUNT COMMANDS",  

子命令:

{
        Name:   "new",
        Usage:  "Create a new account",
        Action: utils.MigrateFlags(accountCreate),
        Flags: []cli.Flag{
          utils.DataDirFlag,
          utils.KeyStoreDirFlag,
          utils.PasswordFileFlag,
          utils.LightKDFFlag,
        },
        Description: `
    geth account new

Creates a new account and prints the address.

The account is saved in encrypted format, you are prompted for a passphrase.

You must remember this passphrase to unlock your account in the future.

For non-interactive use the passphrase can be specified with the --password flag:

Note, this is meant to be used for testing only, it is a bad idea to save your
password to file or expose in any other way.
`,
      }

账户相关的命令在cmd/geth/accountcmd.go里,新建账户命令为new,其会调accountCreate方法,accountCreate在CLI标志定义的密钥库中创建一个新帐户

func accountCreate(ctx *cli.Context) error {
  cfg := gethConfig{Node: defaultNodeConfig()}
  // Load config file.
  if file := ctx.GlobalString(configFileFlag.Name); file != "" {
    if err := loadConfig(file, &cfg); err != nil {
      utils.Fatalf("%v", err)
    }
  }
  utils.SetNodeConfig(ctx, &cfg.Node)
  scryptN, scryptP, keydir, err := cfg.Node.AccountConfig()

  if err != nil {
    utils.Fatalf("Failed to read configuration: %v", err)
  }

  password := getPassPhrase("Your new account is locked with a password. Please give a password. Do not forget this password.", true, 0, utils.MakePasswordList(ctx))

  address, err := keystore.StoreKey(keydir, password, scryptN, scryptP)

  if err != nil {
    utils.Fatalf("Failed to create account: %v", err)
  }
  fmt.Printf("Address: {%x}\n", address)
  return nil
}

获取配置并解析用户的密码, StoreKey生成一个密钥,用’auth’加密并存储在给定的目录中

func StoreKey(dir, auth string, scryptN, scryptP int) (common.Address, error) {
  _, a, err := storeNewKey(&keyStorePassphrase{dir, scryptN, scryptP}, crand.Reader, auth)
  return a.Address, err
}

storeNewKey()来创建一个新的账户,具体表现为生成一对公私钥,再由私钥算出地址并构建一个自定义的Key

func storeNewKey(ks keyStore, rand io.Reader, auth string) (*Key, accounts.Account, error) {
  key, err := newKey(rand)
  if err != nil {
    return nil, accounts.Account{}, err
  }
  a := accounts.Account{Address: key.Address, URL: accounts.URL{Scheme: KeyStoreScheme, Path: ks.JoinPath(keyFileName(key.Address))}}
  if err := ks.StoreKey(a.URL.Path, key, auth); err != nil {
    zeroKey(key.PrivateKey)
    return nil, a, err
  }
  return key, a, err
}

Key的生成函数,通过椭圆曲线加密生成的私钥,生成Key

func newKey(rand io.Reader) (*Key, error) {
  privateKeyECDSA, err := ecdsa.GenerateKey(crypto.S256(), rand)
  if err != nil {
    return nil, err
  }
  return newKeyFromECDSA(privateKeyECDSA), nil
}

生成公钥和私钥对,ecdsa.GenerateKey(crypto.S256(), rand) 以太坊采用了椭圆曲线数字签名算法(ECDSA)生成一对公私钥,并选择的是secp256k1曲线

func GenerateKey(c elliptic.Curve, rand io.Reader) (*PrivateKey, error) {
  k, err := randFieldElement(c, rand)
  if err != nil {
    return nil, err
  }

  priv := new(PrivateKey)
  priv.PublicKey.Curve = c
  priv.D = k
  priv.PublicKey.X, priv.PublicKey.Y = c.ScalarBaseMult(k.Bytes())
  return priv, nil
}

以太坊使用私钥通过 ECDSA算法推导出公钥,继而经过 Keccak-256 单向散列函数推导出地址

func newKeyFromECDSA(privateKeyECDSA *ecdsa.PrivateKey) *Key {           
  id := uuid.NewRandom()                                               
  key := &Key{                                                         
    Id:         id,                                                  
    Address:    crypto.PubkeyToAddress(privateKeyECDSA.PublicKey),   
    PrivateKey: privateKeyECDSA,                                     
  }                                                                    
  return key                                                           
}                                                                        

func PubkeyToAddress(p ecdsa.PublicKey) common.Address {
  pubBytes := FromECDSAPub(&p)
  return common.BytesToAddress(Keccak256(pubBytes[1:])[12:])
}

地址代表以太坊帐户的20字节地址

const (
  HashLength    = 32
  AddressLength = 20
)

type Address [AddressLength]byte

func BytesToAddress(b []byte) Address {
  var a Address
  a.SetBytes(b)
  return a
}
func BigToAddress(b *big.Int) Address { return BytesToAddress(b.Bytes()) }
func HexToAddress(s string) Address   { return BytesToAddress(FromHex(s)) }

总结,整个过程如下:

  • 创建随机私钥 (64 位 16 进制字符 / 32 字节)
  • 从私钥推导出公钥 (128 位 16 进制字符 / 64 字节)
  • 从公钥推导出地址 (40 位 16 进制字符 / 20 字节)

GitHub地址:

https://github.com/guoshijiang/go-ethereum-code-analysis
关注问我技术公众号,加小问,拉您入技术交流群:
在这里插入图片描述

geth账户管理转账 参考http://blog.youkuaiyun.com/CHENYUFENG1991/article/details/53458175?locationNum=7&fps=1进入geth geth –identity “newEth” –rpc –rpccorsdomain “*” –datadir “./cdata” –port 30303 –rpcapi “db, eth,net,web3” –net 阅读详情

相关推荐

【原创,解决CLodop安装后无法调用的问题】已经安装过CLodop,但是网页上仍然提示“clodop云打印服务(localhost本地)未安装启动,点击这里执行安装....”

在某些国内web网站中,需要安装一个名为“CLodop”的插件;但在实际使用过程中,即使安装了CLodop插件,网页试图调用它时还是会提示“clodop云打印服务(localhost本地)未安装启动,点击这里执行安装...”,且无法完成相关打印任务 本文属原创博客,分析了解决CLodop无法被调用的问题,并附上了原理和解决方法,本质上是和跨域请求以及CORS类安全组策略相关

link_in_csdn的博客 2万+

geth new account php,从命令行开始解析以太坊新建账户过程(geth account new命令)

从命令行开始解析以太坊新建账户过程(geth account new命令)如上图是生成一个账户的过程,最后的账户表现为一个地址那么,这个过程的代码是怎么实现的呢,接下来我们从main函数命令行开始解析这个过程的代码。在cmd/geth/main.go中的init函数中,有一个accountCommand的命令行参数func init() {// Initialize the CLI app and...

weixin_36301639的博客 497

ali140滑块

ali 140滑块采用补环境的方式进行逆向,需要的文件主要为这两个,其中collina.js是最主要的环境校验和参数加密的逻辑,这两个文件放本地进行补环境。然后挂上代理,先保证能够正常运行代码,补了些许后能够正常运行了,我们打印最主要的加密函数看看:n值就是得到:挂上代理看看鼠标事件,不管加密逻辑,关心入参即可:收集一些鼠标事件传进记录的函数。其余就是处理一些环境值,一些resetSA的逻辑就行。截图记录:

bboysteed的博客 1678

geth new account php,geth账户管理指南

使用geth的account命令管理账户:geth account [options...] [arguments...]命令 - commandlist 列表显示现有账户new 创建一个新的账户update 修改账户import 导入私钥创建新账户可以使用--help获取这些命令的帮助信息,例如:~$ geth account list --helplist [command...

weixin_36219894的博客 396

告别实车测试:手把手教你用Vector VT平台搭建OBC/DCDC的HIL测试台架

本文详细介绍了如何利用Vector VT平台搭建新能源汽车OBC/DCDC的HIL测试台架,涵盖硬件选型、模型部署到自动化测试的全流程。通过HIL仿真测试技术,工程师可以高效验证动力域关键部件,大幅缩短开发周期并降低成本,特别适合新能源汽车三电系统的开发验证。

weixin_42659194的博客 339

工商银行软件开发中心数据安全监测溯源防护体系建设成果及展望

结合业界先进溯源理念和我行管理要求,依托大数据、分布式搜索分析引擎等技术,构建PB级海量数据加工分析和小时级快速核验、检索、溯源手段(如图6所示),支撑6种客户敏感信息关键要素的单一或组合溯源,形成行之有效的数据安全溯源流程,配套落地自动化快速泄露样本真实性核验和灵活高效的溯源能力,通过数据相关属性的自动化分析,实现追踪泄露源头、明确泄露路径的目标,为有效应对数据安全事件,降低和消除风险与不良影响,开展事后追责处置工作提供体系化解决方案。提高数据排查的自动化程度和排查效率,降低人工成本。

银行信息系统应用架构详解 225

geth常见报错:personal已经弃用

如下:geth --datadir node1 --networkid 1008 --rpc.enabledeprecatedpersonal --nodiscover console 2>1.log。大体意思就是personal这个namespace已经不用了,如果再想用的话,需要通过。新geth版本中已经弃用personal对象。

fdbright的博客 1298

Spring AI 项目实战(十二):Spring Boot +AI + DeepSeek + 百度OCR 公司发票智能处理系统的技术实践(附完整源码)

本文介绍了基于百度OCR API与DeepSeek AI的发票智能处理系统,通过整合AI技术实现发票识别、信息提取和验证的全流程自动化。系统采用Spring Boot 3.2.0架构,结合百度OCR的高精度图像识别和DeepSeek的语义理解能力,显著提升了发票处理效率与准确率。关键技术包括多模型融合、智能错误纠正和自适应学习机制,实现了95%以上的识别准确率,将传统处理效率提升90%以上。该系统为数字化转型中的企业财务管理提供了智能化解决方案,具备高精度识别、实时处理、智能验证等核心优势。

博客 1627

以太坊开发--使用geth搭建私有链

我在上一篇博客中《以太坊开发--geth的使用入门》中使用的是geth的开发环境,准确来说和私链还是不同的。今天我们就学习来搭建一个以太坊私链。我们知道区块链有三种:公有链、联盟链、私有链。我会在之后的博客中详细讲述这三者的不同,今天主要来实现建立私有链的步骤。兑换geth环境和其他区块链环境的配置请参考《区块链-以太坊开发环境搭建介绍》这篇博客。(1)首先在命令行中使用“geth account

乞力马扎罗的雪CYF的博客 1万+

SAP PFCG 中的单一角色与复合角色

在 SAP 系统的安全与授权管理中,事务码 PFCG(角色维护)扮演着关键角色。理解单一角色(Single Role)和复合角色(Composite Role)的概念,对于有效地管理用户权限至关重要。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 1478

mapbox高阶,加载倾斜摄影

本文详细介绍如何基于mapbox-gl v3.8.0版本实现倾斜摄影的加载,亲测可用。希望能帮助到您。一起学习,加油!加油!

我哎GIS博客 345

geth如何解锁账户?

2019独角兽企业重金招聘Python工程师标准>>> ...

weixin_34120274的博客 3032

5G/NR SSB学习总结

6.1 SSB概念 同步信号和PBCH块(Synchronization Signal and PBCH block, 简称SSB),它由主同步信号(Primary Synchronization Signals, 简称PSS)、辅同步信号(Secondary Synchronization Signals, 简称SSS)、PBCH三部分共同组成。 6.2 SSB特征 ...

欢迎来到小七的博客,这里将带你深入探索5G通信的神秘世界。无论你是通信领域的专业人士还是对这一领域充满好奇心的技术爱好者,这里都有专业协议解读、通信知识普及以及有趣的Python编程内容等你发现。 8万+

geth 新建账户

使用geth的account命令管理账户,例如创建新账户、更新账户密码、查询账户等: geth account <command> [options...] [arguments...] 命令 - command list 列表显示现有账户 new 创建一个新的账户 update 修改账...

weixin_30832351的博客 988

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

区块链系列教程——geth命令详解

本文是区块链系列的第二篇,上一篇区块链系列教程——创建属于自己的区块链大概介绍了区块链的基本内容,并且使用geth客户端创建了私链,给了各位读者较为直观的感受。本文简单介绍geth命令,这对后面的教程来说是一个基础。 geth用法简介 在安装有geth的环境下,使用命令即可查看geth的所有操作参数: geth -help 其用法为: geth [options] command [comm...

程序员Sunny的博客 3720

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

geth new account php,以太坊geth web3j personalNewAccount返回null

在通过web3j依赖包提供的api调用personalNewAccount方法返回null,也就是说并没有真正生成地址。这是什么原因导致的呢?如下代码调用:String password = EthereumConfiguration.getWalletPwd();NewAccountIdentifier newAccountIdentifier;try {newAccountIdentifier...

weixin_35991051的博客 666

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

以太坊教程

Geth 还负责重新执行到达新区块的交易,以确保它们有效,执行交易是在 Geth 的嵌入式计算机上完成的,称为以太坊虚拟机 (EVM)。共识客户端处理使节点能够与以太坊网络保持同步的所有逻辑,有自己的点对点网络,与将执行客户端相互连接的网络分开。是共识客户端的可选附加组件,比如POS共识机制,如果已将 32 个 ETH 发送到存款合约,则可以将验证者添加到共识客户端,进行出块与验证。注意extradata的最高的256位为0,如果是16进制表示,就是最前面64个数字是0。

m0_55078771的博客 999

RxJS 4 `Rx.config` 全局配置指南:自定义 Promise 实现与事件绑定策略

`Rx.config` 是 RxJS 4(Reactive Extensions for JavaScript)提供的全局配置对象,用于在不修改源码的前提下调整库的核心行为。本文以仓库文档 [doc/api/config/readme.md](https://link.gitcode.com/i/a9c5d2c87bad7e10f5d24cd0ab471069) 为主线,结合 [src/core/

gitblog_01032的博客 1126

以太坊系列之账户管理

想知道更多关于区块链技术知识,请百度【链客区块链技术问答社区】 链客,有问必答!! 账户 以太坊有两种账户类型: 外部账户(EOA) 合约账户 所有账户的状态代表以太坊网络的状态,以太坊网络会和每一个区块一起更新,网络需要达成关于以太坊的共识。账户代表外部代理人的身份,账户运用非对称加密的私钥来签署交易,以便以太坊虚拟机可以安全验证交易发送者的身份。 钥匙文件(Keyfiles) 每个账户都由...

weixin_44172023的博客 1028

如何从零构建以太坊账户系统:Geth私钥生成与地址计算实战

以太坊账户系统是区块链交互的基础,本文将带你快速掌握以太坊账户的核心原理,包括私钥生成、公钥提取和地址计算的完整流程。通过Geth源码解析和实战示例,即使是区块链新手也能轻松理解账户安全的底层逻辑。 ## 以太坊账户的核心构成 以太坊账户分为外部账户(EOA)和合约账户两种类型,其中外部账户由用户直接控制,通过私钥进行交易签名。每个账户都拥有唯一的20字节地址,类似于银行账户的账号,而私钥则相

gitblog_01092的博客 375

使用geth搭建以太坊私链详细步骤

摘要使用geth客户端搭建以太坊私链,创始区块配置,以分配初始以太币,启动geth参数。 使用geth客户端搭建私链,操作过程如下。 1.生成账户 geth account new geth account new 输入密码 生成...

Harry Wong的博客 740

truffle 的geth

进入geth以后创建新的账户参考http://blog.youkuaiyun.com/CHENYUFENG1991/article/details/53458175?locationNum=7&fps=1eth.accounts [] eth.accounts [“0x9a647332df73cf582fce51ac2b2551d110218040”] personal.ne

DDFFR的博客 1483

dqkg的命令用法_以太坊客户端Geth命令用法-参数详解

Geth在以太坊智能合约开发中最常用的工具(必备开发工具),一个多用途的命令行工具。熟悉Geth可以让我们有更好的效率,大家可收藏起来作为Geth命令用法手册。 本文主要是对geth help的翻译,基于最新的geth 1.7.3-stable版本。如果你还不知道geth是什么,请先阅读入门篇:以太坊是什么。以下开始正文。命令用法geth [选项] 命令 [命令选项] [参数…]版本:1.7.3-...

weixin_39994665的博客 143

以太坊geth新版本error:account unlock with HTTP access is forbidden

使用最新版本geth客户,当执行personal.unlockAccount()或在程序中调用personal_unlockAccount接口时,会出现:account unlock with HTTP access is forbidden异常。 异常原因 新版本geth,出于安全考虑,默认禁止了HTTP通道解锁账户,相关issue:https://github.com/ethereum/go-...

程序新视界 1万+

geth账户管理指南

使用geth的account命令管理账户: geth account <command> [options...] [arguments...] 命令 - command list 列表显示现有账户 new 创建一个新的账户 update 修改账户 import 导入私钥创建新账户 可以使用--help获取这...

weixin_34402408的博客 1512
上一篇: cmd中Geth重要衔接包代码简析
下一篇: 从命令行开始解析同步区块的代码
The_Web3_社区
博客等级 码龄10年 388粉丝 154原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

The_Web3_社区

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值