bip44

package module
v0.0.0-...-711bc36 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2018 License: MIT Imports: 7 Imported by: 0

README

比特币"靓号"生成工具

简介

遵循 bip32 、bip39、 bip44 协议。不停随机生成助记词(私钥)生成地址,筛出满足条件前缀的比特币地址。

例如 1BTChwLPGp9d1aQAgghpU2gzE3zd9PG3Vj 这个有 BTC 前缀的地址就算是靓号啦。

当然你也可以指定长一些的前缀,比如 iLoveBtc,但是越长就越难撞出。

使用方式

使用方式有两种,没有 go 环境的可以直接使用编译好的可执行文件。 有开发能力的同学,可以选择自己编译运行。

1. 直接使用

根据系统选择执行 main-mac、main-windows.exe、main-linux

 cd main/
 ./main-xxx
2. 自己编译
  1. 需要安装dep
  2. dep ensure
  3. go run main.go
输入输出
  1. 在执行目录下新建名为 input 的文件
  2. input 可写多个要筛选的前缀,可写多行,一行一个
  3. 前缀设置的越短,越容易撞出
  4. 撞出的结果会收录在 ans 文件夹内

注意

base58 编码没有这些字母、数字:

大写字母 I
小写字母 l
大写字母 O
数字 0

因此靓号地址前缀无法包含以上字母数字,请悉知,不要徒劳。

依赖

go-bip44

btcd

btcutil

go-bip39

Documentation

Index

Constants

View Source
const HardenedKeyZeroIndex = 0x80000000

Variables

This section is empty.

Functions

func EncodeURI

func EncodeURI(p URIParams) (string, error)

Types

type AccountKey

type AccountKey struct {
	// contains filtered or unexported fields
}

func NewAccountKeyFromXPubKey

func NewAccountKeyFromXPubKey(value string) (*AccountKey, error)

func (*AccountKey) DeriveP2PKAddress

func (k *AccountKey) DeriveP2PKAddress(changeType ChangeType, index uint32, network Network) (*Address, error)

type Address

type Address struct {
	HDStartPath HDStartPath `json:"hd_start_path"`
	HDEndPath   HDEndPath   `json:"hd_end_path"`
	Value       string      `json:"value"`
}

type ChangeType

type ChangeType uint32
const (
	ExternalChangeType ChangeType = 0
	InternalChangeType ChangeType = 1
)

type CoinType

type CoinType uint32
const (
	BitcoinCoinType CoinType = 0
	TestnetCoinType CoinType = 1
)

type ExtendedKey

type ExtendedKey struct {
	Key *hdkeychain.ExtendedKey
}

func NewKeyFromSeedBytes

func NewKeyFromSeedBytes(seed []byte, net Network) (*ExtendedKey, error)

func NewKeyFromSeedHex

func NewKeyFromSeedHex(seed string, net Network) (*ExtendedKey, error)

func (*ExtendedKey) BIP44AccountKey

func (e *ExtendedKey) BIP44AccountKey(coinType CoinType, accIndex uint32, includePrivateKey bool) (*AccountKey, error)

type HDEndPath

type HDEndPath struct {
	ChangeIndex  uint32 `json:"change_index"`
	AddressIndex uint32 `json:"address_index"`
}

type HDStartPath

type HDStartPath struct {
	PurposeIndex  uint32 `json:"purpose_index"`
	CoinTypeIndex uint32 `json:"coin_type"`
	AccountIndex  uint32 `json:"account_index"`
}

type Mnemonic

type Mnemonic struct {
	Value string
}

func NewMnemonic

func NewMnemonic(bitSize int) (*Mnemonic, error)

bitSize must be a multiple of 32

func ParseMnemonic

func ParseMnemonic(mnemonic string) Mnemonic

func (Mnemonic) NewSeed

func (m Mnemonic) NewSeed(password string) ([]byte, error)

type Network

type Network int16
const (
	TESTNET3 Network = 0
	MAINNET  Network = 1
)

type Purpose

type Purpose uint32
const (
	BIP44Purpose Purpose = 44
)

type URIParams

type URIParams struct {
	Address string
	Amount  float64
	Label   string
	Message string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL