热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

EthereumHDKDF

2019独角兽企业重金招聘Python工程师标准TheresalongdiscussionaboutusingBIP32(theBitcoinHDwalletKDF)andB

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

There's a long discussion about using BIP32 (the Bitcoin HD wallet KDF) and BIP44 (the KDF path standard) for Ethereum.

It was raised that perhaps a different scheme could be useful.

How Bitcoin HD wallets work?

  1. A mnemonic (i.e. a list of memorable words) is generated (see BIP39)

  2. This mnemonic is converted to a seed using PBKDF2 (see BIP39)

  3. The seed is used to generate root private key using SHA512-HMAC (see BIP32)

  4. From this root key, sub keys are derived (see BIP32), where the node layout is set by BIP44

BIP32

What makes BIP32 useful:

  • in use for multiple years and was subject to more scrutiny
  • multiple implementations in multiple languages exist (with varying level of quality)
  • multiple hardware solutions implement it
  • can support a wallet, where the same nodes are used as keys for Bitcoin and Ethereum (bad idea)

Where BIP32 may be lacking:

  • it doesn't magically make Ethereum work with those BIP32 implementations (including hardware wallets). They are pretty much catered for Bitcoin only.
  • the path structure is very rigid (each path element is practically limited to 31 bits), fitting in long data (such as token addresses) feels a bit clumsy
  • it is battle tested, but that doesn't mean it couldn't be improved (see this recent proposal for improving edge-cases)

Ethereum scheme

Requirements:

  1. be compatible with the Bitcoin scheme as much as possible

  2. use native Ethereum methods where possible

  3. support per-contract (token) layouts

  4. should it support the ability for outsiders to derive public keys?

  5. should have a deterministic way to solve the node skipping issue (where a path would result in an invalid private key)

  6. should it have a way for node discovery? (see BIP44)

Derivation paths

  • /general/
  • /contract//
  • /token//

Where  is a counter starting from 0.

Simple derivation

It should share the same seed as output by BIP39. This means the same seed can be shared by BIP32 and this scheme.

A given private key can be calculated via: privKey = sha3(rlp([seed, [path array]]))

This doesn't satisfy points 4), 5) and 6) of the requirements.

A possible solution for 5) is to have a nonce to increment as the last parameter of the RLP if an invalid node is derived.

A possible solution for 4) is to move the nonce outside the RLP and use it via the public key derivation used in BIP32.

A wild idea for node discovery:

  1. Store the derived paths in a text format (maybe JSON?) and encrypt it with a specific node

  2. Store the encrypted list in IPFS/Swarm

  3. Have a "namereg" to map the IPFS/Swarm address to an address of another specific node


转:https://my.oschina.net/u/855913/blog/1605886



推荐阅读
  • 本文介绍了设计师伊振华受邀参与沈阳市智慧城市运行管理中心项目的整体设计,并以数字赋能和创新驱动高质量发展的理念,建设了集成、智慧、高效的一体化城市综合管理平台,促进了城市的数字化转型。该中心被称为当代城市的智能心脏,为沈阳市的智慧城市建设做出了重要贡献。 ... [详细]
  • 微软头条实习生分享深度学习自学指南
    本文介绍了一位微软头条实习生自学深度学习的经验分享,包括学习资源推荐、重要基础知识的学习要点等。作者强调了学好Python和数学基础的重要性,并提供了一些建议。 ... [详细]
  • Spring源码解密之默认标签的解析方式分析
    本文分析了Spring源码解密中默认标签的解析方式。通过对命名空间的判断,区分默认命名空间和自定义命名空间,并采用不同的解析方式。其中,bean标签的解析最为复杂和重要。 ... [详细]
  • 本文主要解析了Open judge C16H问题中涉及到的Magical Balls的快速幂和逆元算法,并给出了问题的解析和解决方法。详细介绍了问题的背景和规则,并给出了相应的算法解析和实现步骤。通过本文的解析,读者可以更好地理解和解决Open judge C16H问题中的Magical Balls部分。 ... [详细]
  • 本文详细介绍了Linux中进程控制块PCBtask_struct结构体的结构和作用,包括进程状态、进程号、待处理信号、进程地址空间、调度标志、锁深度、基本时间片、调度策略以及内存管理信息等方面的内容。阅读本文可以更加深入地了解Linux进程管理的原理和机制。 ... [详细]
  • Python正则表达式学习记录及常用方法
    本文记录了学习Python正则表达式的过程,介绍了re模块的常用方法re.search,并解释了rawstring的作用。正则表达式是一种方便检查字符串匹配模式的工具,通过本文的学习可以掌握Python中使用正则表达式的基本方法。 ... [详细]
  • 开发笔记:实验7的文件读写操作
    本文介绍了使用C++的ofstream和ifstream类进行文件读写操作的方法,包括创建文件、写入文件和读取文件的过程。同时还介绍了如何判断文件是否成功打开和关闭文件的方法。通过本文的学习,读者可以了解如何在C++中进行文件读写操作。 ... [详细]
  • 本文介绍了在CentOS上安装Python2.7.2的详细步骤,包括下载、解压、编译和安装等操作。同时提供了一些注意事项,以及测试安装是否成功的方法。 ... [详细]
  • 先看官方文档TheJavaTutorialshavebeenwrittenforJDK8.Examplesandpracticesdescribedinthispagedontta ... [详细]
  • JDK源码学习之HashTable(附带面试题)的学习笔记
    本文介绍了JDK源码学习之HashTable(附带面试题)的学习笔记,包括HashTable的定义、数据类型、与HashMap的关系和区别。文章提供了干货,并附带了其他相关主题的学习笔记。 ... [详细]
  • 如何查询zone下的表的信息
    本文介绍了如何通过TcaplusDB知识库查询zone下的表的信息。包括请求地址、GET请求参数说明、返回参数说明等内容。通过curl方法发起请求,并提供了请求示例。 ... [详细]
  • 本文介绍了OpenStack的逻辑概念以及其构成简介,包括了软件开源项目、基础设施资源管理平台、三大核心组件等内容。同时还介绍了Horizon(UI模块)等相关信息。 ... [详细]
  • 本文介绍了如何使用JSONObiect和Gson相关方法实现json数据与kotlin对象的相互转换。首先解释了JSON的概念和数据格式,然后详细介绍了相关API,包括JSONObject和Gson的使用方法。接着讲解了如何将json格式的字符串转换为kotlin对象或List,以及如何将kotlin对象转换为json字符串。最后提到了使用Map封装json对象的特殊情况。文章还对JSON和XML进行了比较,指出了JSON的优势和缺点。 ... [详细]
  • 使用圣杯布局模式实现网站首页的内容布局
    本文介绍了使用圣杯布局模式实现网站首页的内容布局的方法,包括HTML部分代码和实例。同时还提供了公司新闻、最新产品、关于我们、联系我们等页面的布局示例。商品展示区包括了车里子和农家生态土鸡蛋等产品的价格信息。 ... [详细]
  • eclipse学习(第三章:ssh中的Hibernate)——11.Hibernate的缓存(2级缓存,get和load)
    本文介绍了eclipse学习中的第三章内容,主要讲解了ssh中的Hibernate的缓存,包括2级缓存和get方法、load方法的区别。文章还涉及了项目实践和相关知识点的讲解。 ... [详细]
author-avatar
鹰击长空1943
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有