All Projects → miguelmota → Go Ethereum Hdwallet

miguelmota / Go Ethereum Hdwallet

Licence: mit
Ethereum HD Wallet derivations in Go (golang)

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Go Ethereum Hdwallet

Unstoppable Wallet Android
A secure and decentralized Bitcoin and other cryptocurrency wallet for Android phones. Supports Bitcoin, Ethereum, EOS, Binance Chain, Bitcoin Cash, DASH, ...
Stars: ✭ 165 (-7.3%)
Mutual labels:  blockchain, ethereum, wallet
Ethnode
Run an Ethereum node (Geth or Openethereum) for development
Stars: ✭ 74 (-58.43%)
Mutual labels:  blockchain, ethereum, geth
Disperse
React/Redux dApp (decentralized app) boilerplate using Ethereum's blockchain
Stars: ✭ 36 (-79.78%)
Mutual labels:  blockchain, ethereum, seed
Weiwallet Android
Wei Wallet is an open source Ethereum wallet for Android
Stars: ✭ 20 (-88.76%)
Mutual labels:  blockchain, ethereum, wallet
Desktop
The official Musicoin Desktop Wallet Application
Stars: ✭ 112 (-37.08%)
Mutual labels:  blockchain, ethereum, wallet
Go Ethereum
Official Go implementation of the Ethereum protocol
Stars: ✭ 34,169 (+19096.07%)
Mutual labels:  blockchain, ethereum, geth
Nethereum
Ethereum .Net cross platform integration library
Stars: ✭ 1,191 (+569.1%)
Mutual labels:  blockchain, ethereum, geth
Weiwallet Ios
Wei Wallet is an open source Ethereum wallet for iOS
Stars: ✭ 271 (+52.25%)
Mutual labels:  blockchain, ethereum, wallet
Eth Indexer
An Ethereum project to crawl blockchain states into database
Stars: ✭ 98 (-44.94%)
Mutual labels:  blockchain, ethereum, geth
Etherwalletkit
Ethereum Wallet Toolkit for iOS - You can implement an Ethereum wallet without a server and blockchain knowledge.
Stars: ✭ 96 (-46.07%)
Mutual labels:  blockchain, ethereum, wallet
Ethermint Archive
Ethereum on Tendermint using Cosmos-SDK!
Stars: ✭ 667 (+274.72%)
Mutual labels:  blockchain, ethereum, geth
Alpha Wallet Ios
An advanced Ethereum mobile wallet
Stars: ✭ 140 (-21.35%)
Mutual labels:  blockchain, ethereum, wallet
Ethereumkit
EthereumKit is a free, open-source Swift framework for easily interacting with the Ethereum.
Stars: ✭ 400 (+124.72%)
Mutual labels:  blockchain, ethereum, wallet
Toshi Android Client
Android client for Toshi
Stars: ✭ 167 (-6.18%)
Mutual labels:  blockchain, ethereum, wallet
Status React
a free (libre) open source, mobile OS for Ethereum
Stars: ✭ 3,307 (+1757.87%)
Mutual labels:  blockchain, ethereum, wallet
Ethdroid
Easy-to-use Ethereum Geth wrapper for Android
Stars: ✭ 47 (-73.6%)
Mutual labels:  blockchain, ethereum, geth
Blockchainwallet Crypto
比特币、以太坊公私钥生成以及签名,长时间不维护可移步 https://github.com/QuincySx/ChainWallet
Stars: ✭ 183 (+2.81%)
Mutual labels:  blockchain, ethereum, wallet
Celo Monorepo
Official repository for core projects comprising the Celo platform
Stars: ✭ 269 (+51.12%)
Mutual labels:  blockchain, ethereum, wallet
Trust Wallet Ios
📱 Trust - Ethereum Wallet and Web3 DApp Browser for iOS
Stars: ✭ 1,228 (+589.89%)
Mutual labels:  blockchain, ethereum, wallet
Alpha Wallet Android
An advanced Ethereum mobile wallet
Stars: ✭ 133 (-25.28%)
Mutual labels:  blockchain, ethereum, wallet


logo


go-ethereum-hdwallet

Ethereum HD Wallet derivations from [mnemonic] seed in Go (golang). Implements the go-ethereum accounts.Wallet interface.

License Build Status Go Report Card GoDoc PRs Welcome

Install

go get -u github.com/miguelmota/go-ethereum-hdwallet

Documenation

https://godoc.org/github.com/miguelmota/go-ethereum-hdwallet

Getting started

package main

import (
	"fmt"
	"log"

	"github.com/miguelmota/go-ethereum-hdwallet"
)

func main() {
	mnemonic := "tag volcano eight thank tide danger coast health above argue embrace heavy"
	wallet, err := hdwallet.NewFromMnemonic(mnemonic)
	if err != nil {
		log.Fatal(err)
	}

	path := hdwallet.MustParseDerivationPath("m/44'/60'/0'/0/0")
	account, err := wallet.Derive(path, false)
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(account.Address.Hex()) // 0xC49926C4124cEe1cbA0Ea94Ea31a6c12318df947

	path = hdwallet.MustParseDerivationPath("m/44'/60'/0'/0/1")
	account, err = wallet.Derive(path, false)
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(account.Address.Hex()) // 0x8230645aC28A4EdD1b0B53E7Cd8019744E9dD559
}

Signing transaction

package main

import (
	"log"
	"math/big"

	"github.com/davecgh/go-spew/spew"
	"github.com/ethereum/go-ethereum/common"
	"github.com/ethereum/go-ethereum/core/types"
	"github.com/miguelmota/go-ethereum-hdwallet"
)

func main() {
	mnemonic := "tag volcano eight thank tide danger coast health above argue embrace heavy"
	wallet, err := hdwallet.NewFromMnemonic(mnemonic)
	if err != nil {
		log.Fatal(err)
	}

	path := hdwallet.MustParseDerivationPath("m/44'/60'/0'/0/0")
	account, err := wallet.Derive(path, true)
	if err != nil {
		log.Fatal(err)
	}

	nonce := uint64(0)
	value := big.NewInt(1000000000000000000)
	toAddress := common.HexToAddress("0x0")
	gasLimit := uint64(21000)
	gasPrice := big.NewInt(21000000000)
	var data []byte

	tx := types.NewTransaction(nonce, toAddress, value, gasLimit, gasPrice, data)
	signedTx, err := wallet.SignTx(account, tx, nil)
	if err != nil {
		log.Fatal(err)
	}

	spew.Dump(signedTx)
}

CLI

go get -u github.com/miguelmota/go-ethereum-hdwallet/cmd/geth-hdwallet
$ geth-hdwallet -mnemonic "tag volcano eight thank tide danger coast health above argue embrace heavy" -path "m/44'/60'/0'/0/0"

public address: 0xC49926C4124cEe1cbA0Ea94Ea31a6c12318df947
private key: 63e21d10fd50155dbba0e7d3f7431a400b84b4c2ac1ee38872f82448fe3ecfb9

Test

make test

Contributing

Pull requests are welcome!

For contributions please create a new branch and submit a pull request for review.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].