基于区块链的毕业设计go-eth2-wallet-distributed – go-eth2-wallet-distributed

本文提供基于区块链的毕业设计国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,基于区块链的毕业设计go-eth2-wallet-distributed – go-eth2-wallet-distributed 是一篇很好的国外资料

go-eth2-wallet-distributed

go-eth2-wallet-distributed - go-eth2-wallet-distributed go-eth2-wallet-distributed - go-eth2-wallet-distributed go-eth2-wallet-distributed - go-eth2-wallet-distributed go-eth2-wallet-distributed - go-eth2-wallet-distributed go-eth2-wallet-distributed - go-eth2-wallet-distributed go-eth2-wallet-distributed - go-eth2-wallet-distributed

Distributed Ethereum 2 wallet.

Table of Contents

  • Install
  • Usage
  • Maintainers
  • Contribute
  • License

Install

go-eth2-wallet-distributed is a standard Go module which can be installed with:

go get github.com/wealdtech/go-eth2-wallet-distributed

Usage

Access to the wallet is usually via go-eth2-wallet; the first two examples below shows how this can be achieved.

This wallet generates keys non-deterministically, i.e. there is no relationship between keys or idea of a “seed”.

Wallet and account names may be composed of any valid UTF-8 characters; the only restriction is they can not start with the underscore (_) character.

Due to their nature, distributed wallets are not capable of creating accounts by themselves. Distributed accounts are created by a separate process, and a local part of the distributed wallet can be imported. Note that although distributed wallets do not have passphrases they still need to be unlocked before accounts can be imported. This can be carried out with walllet.Unlock(nil)

Example

Creating a wallet

package main  import ( 	context  	e2wallet "github.com/wealdtech/go-eth2-wallet" )  func main() {      // Create a wallet     wallet, err := e2wallet.CreateWallet("My wallet", e2wallet.WithType("distributed"))     if err != nil {         panic(err)     }      ... }

Accessing a wallet

package main  import ( 	e2wallet "github.com/wealdtech/go-eth2-wallet" )  func main() {      // Open a wallet     wallet, err := e2wallet.OpenWallet("My wallet")     if err != nil {         panic(err)     }      ... }

Importing an account

package main  import ( 	"context"  	e2wallet "github.com/wealdtech/go-eth2-wallet" 	e2wtypes "github.com/wealdtech/go-eth2-wallet-types/v2" )  func main() {  	// Open a wallet 	wallet, err := e2wallet.OpenWallet("My wallet") 	if err != nil { 		panic(err) 	}  	err = wallet.(e2wtypes.WalletLocker).Unlock(context.Background(), nil) 	if err != nil { 		panic(err) 	} 	// Always immediately defer locking the wallet to ensure it does not remain unlocked outside of the function. 	defer wallet.(e2wtypes.WalletLocker).Lock(context.Background())  	// Data obtained from a distributed key generation process. 	privateKey := []byte{ 		0x36, 0xe7, 0x51, 0xee, 0x36, 0x9c, 0x2d, 0xdd, 0xf3, 0x1a, 0x2b, 0x84, 0x0b, 0x05, 0x81, 0x92, 		0x77, 0xfc, 0xb3, 0xde, 0x81, 0xc3, 0xeb, 0x80, 0xde, 0x21, 0xcf, 0x2c, 0x74, 0xd6, 0xda, 0x3b, 	} 	signingThreshold := uint32(2) 	verificationVector := [][]byte{ 		[]byte{ 			0xb6, 0x81, 0x88, 0x71, 0x95, 0x0a, 0x0a, 0x51, 0x13, 0xbe, 0x35, 0xbb, 0x07, 0x06, 0x18, 0x4b, 			0x84, 0x16, 0x40, 0x8a, 0x9e, 0x8b, 0x64, 0x98, 0xd3, 0x07, 0xa5, 0x6f, 0xbb, 0x63, 0x4f, 0x93, 			0x4e, 0xf6, 0x1d, 0x39, 0x88, 0xcd, 0x0d, 0xa3, 0xf0, 0xa8, 0x5d, 0xf9, 0x07, 0x9d, 0x9b, 0x92, 		}, 		[]byte{ 			0x88, 0x8f, 0x45, 0xa1, 0x4a, 0x3f, 0x01, 0xff, 0x7c, 0xd1, 0xd4, 0xb0, 0x8b, 0xec, 0xd8, 0xfd, 			0x55, 0xfb, 0xf9, 0x2f, 0x40, 0xd1, 0x4d, 0xbd, 0xe8, 0xfd, 0x26, 0xe8, 0x65, 0xea, 0xda, 0x99, 			0xf4, 0x6b, 0x85, 0xa3, 0xbd, 0xf4, 0xd2, 0x33, 0xff, 0x3e, 0xe5, 0x67, 0x5d, 0xeb, 0x41, 0xef, 		}, 	} 	participants := map[uint64]string{ 		1: "server1:443", 		2: "server2:443", 		3: "server3:443", 	}  	account, err := wallet.(e2wtypes.WalletDistributedAccountImporter).ImportDistributedAccount(context.Background(), 		"My account", 		privateKey, 		signingThreshold, 		verificationVector, 		participants, 		[]byte("my account secret")) 	if err != nil { 		panic(err) 	}  	// Wallet should be locked as soon as unlocked operations have finished; it is safe to explicitly call wallet.Lock() as well 	// as defer it as per above. 	wallet.(e2wtypes.WalletLocker).Lock(context.Background())  	... }

Maintainers

Jim McDonald: @mcdee.

Contribute

Contributions welcome. Please check out the issues.

License

Apache-2.0 © 2020 Weald Technology Trading Ltd


go-eth2-wallet-distributed

<go-eth2-wallet-distributed><go-eth2-wallet-distributed><go-eth2-wallet-distributed><go-eth2-wallet-distributed><go-eth2-wallet-distributed><go-eth2-wallet-distributed><go-eth2-wallet-distributed><go-eth2-wallet-distributed><go-eth2-wallet-distributed><go-eth2-wallet-distributed>

分布式以太坊eth2钱包

go-eth2-wallet-distributed是一个标准的go模块,可以安装:

通常通过go-eth2-wallet访问钱包;下面的前两个示例说明了如何实现这一点

此钱包不确定地生成密钥,即密钥之间没有关系或“种子”概念

钱包和账户名称可以由任何有效的UTF-8字符组成;唯一的限制是它们不能以下划线()字符开头

由于其性质,分布式钱包无法自行创建帐户。分布式帐户由单独的进程创建,并且可以导入分布式钱包的本地部分。请注意,尽管分布式钱包没有密码,但在导入帐户之前,它们仍然需要解锁。这可以通过wallet.Unlock(nil)来实现。

吉姆·麦克唐纳:@mcdee

欢迎捐款。请查看问题

Apache-2.0©2020 Weald Technology Trading Ltd

go-eth2-wallet-distributed

目录安装

使用

示例

创建钱包

访问钱包

导入帐户

  • 安装
  • 使用
  • 维护者
  • 贡献
  • 许可证
  • 分布式以太坊eth2钱包

    目录安装

    使用

    示例

    创建钱包

    访问钱包

    导入帐户

  • 安装
  • 使用
  • 维护者
  • 贡献
  • 许可证
    • 安装
    • 使用
    • 维护者
    • 贡献
    • 许可证

    使用

    示例

    创建钱包

    访问钱包

    导入帐户

  • 安装
  • 使用
  • 维护者
  • 贡献
  • 许可证
  • go-eth2-wallet-distributed是一个标准的go模块,可以安装:

    go get github.com/wealdtech/go-eth2-wallet-distributed

    示例

    创建钱包

    访问钱包

    导入帐户

  • 安装
  • 使用
  • 维护者
  • 贡献
  • 许可证
  • 通常通过go-eth2-wallet访问钱包;下面的前两个示例说明了如何实现这一点

    此钱包不确定地生成密钥,即密钥之间没有关系或“种子”概念

    钱包和账户名称可以由任何有效的UTF-8字符组成;唯一的限制是它们不能以下划线()字符开头

    由于其性质,分布式钱包无法自行创建帐户。分布式帐户由单独的进程创建,并且可以导入分布式钱包的本地部分。请注意,尽管分布式钱包没有密码,但在导入帐户之前,它们仍然需要解锁。这可以通过wallet.Unlock(nil)来实现。

    创建钱包

    访问钱包

    导入帐户

  • 安装
  • 使用
  • 维护者
  • 贡献
  • 许可证
  • 访问钱包

    导入帐户

  • 安装
  • 使用
  • 维护者
  • 贡献
  • 许可证
  • package main  import ( 	context  	e2wallet "github.com/wealdtech/go-eth2-wallet" )  func main() {      // Create a wallet     wallet, err := e2wallet.CreateWallet("My wallet", e2wallet.WithType("distributed"))     if err != nil {         panic(err)     }      ... }

    导入帐户

  • 安装
  • 使用
  • 维护者
  • 贡献
  • 许可证
  • package main  import ( 	e2wallet "github.com/wealdtech/go-eth2-wallet" )  func main() {      // Open a wallet     wallet, err := e2wallet.OpenWallet("My wallet")     if err != nil {         panic(err)     }      ... }

    Importing an account

    package main  import ( 	"context"  	e2wallet "github.com/wealdtech/go-eth2-wallet" 	e2wtypes "github.com/wealdtech/go-eth2-wallet-types/v2" )  func main() {  	// Open a wallet 	wallet, err := e2wallet.OpenWallet("My wallet") 	if err != nil { 		panic(err) 	}  	err = wallet.(e2wtypes.WalletLocker).Unlock(context.Background(), nil) 	if err != nil { 		panic(err) 	} 	// Always immediately defer locking the wallet to ensure it does not remain unlocked outside of the function. 	defer wallet.(e2wtypes.WalletLocker).Lock(context.Background())  	// Data obtained from a distributed key generation process. 	privateKey := []byte{ 		0x36, 0xe7, 0x51, 0xee, 0x36, 0x9c, 0x2d, 0xdd, 0xf3, 0x1a, 0x2b, 0x84, 0x0b, 0x05, 0x81, 0x92, 		0x77, 0xfc, 0xb3, 0xde, 0x81, 0xc3, 0xeb, 0x80, 0xde, 0x21, 0xcf, 0x2c, 0x74, 0xd6, 0xda, 0x3b, 	} 	signingThreshold := uint32(2) 	verificationVector := [][]byte{ 		[]byte{ 			0xb6, 0x81, 0x88, 0x71, 0x95, 0x0a, 0x0a, 0x51, 0x13, 0xbe, 0x35, 0xbb, 0x07, 0x06, 0x18, 0x4b, 			0x84, 0x16, 0x40, 0x8a, 0x9e, 0x8b, 0x64, 0x98, 0xd3, 0x07, 0xa5, 0x6f, 0xbb, 0x63, 0x4f, 0x93, 			0x4e, 0xf6, 0x1d, 0x39, 0x88, 0xcd, 0x0d, 0xa3, 0xf0, 0xa8, 0x5d, 0xf9, 0x07, 0x9d, 0x9b, 0x92, 		}, 		[]byte{ 			0x88, 0x8f, 0x45, 0xa1, 0x4a, 0x3f, 0x01, 0xff, 0x7c, 0xd1, 0xd4, 0xb0, 0x8b, 0xec, 0xd8, 0xfd, 			0x55, 0xfb, 0xf9, 0x2f, 0x40, 0xd1, 0x4d, 0xbd, 0xe8, 0xfd, 0x26, 0xe8, 0x65, 0xea, 0xda, 0x99, 			0xf4, 0x6b, 0x85, 0xa3, 0xbd, 0xf4, 0xd2, 0x33, 0xff, 0x3e, 0xe5, 0x67, 0x5d, 0xeb, 0x41, 0xef, 		}, 	} 	participants := map[uint64]string{ 		1: "server1:443", 		2: "server2:443", 		3: "server3:443", 	}  	account, err := wallet.(e2wtypes.WalletDistributedAccountImporter).ImportDistributedAccount(context.Background(), 		"My account", 		privateKey, 		signingThreshold, 		verificationVector, 		participants, 		[]byte("my account secret")) 	if err != nil { 		panic(err) 	}  	// Wallet should be locked as soon as unlocked operations have finished; it is safe to explicitly call wallet.Lock() as well 	// as defer it as per above. 	wallet.(e2wtypes.WalletLocker).Lock(context.Background())  	... }

    Maintainers

    吉姆·麦克唐纳:@mcdee

    Contribute

    欢迎捐款。请查看问题

    License

    Apache-2.0©2020 Weald Technology Trading Ltd

    部分转自网络,侵权联系删除区块链源码网

    www.interchains.cc

    https://www.interchains.cc/24406.html

    区块链毕设网(www.interchains.cc)全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 ! QQ3039046426
    区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » 基于区块链的毕业设计go-eth2-wallet-distributed – go-eth2-wallet-distributed

    提供最优质的资源集合

    立即查看 了解详情