Skip to content

generate a chia address by public key, chia公钥生成地址

License

Notifications You must be signed in to change notification settings

chuwt/chia-address-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chia-address-generator

This repo is a hack way to generate an address from publicKey. So it's not a good enough way to use it in prod, use it just for personal

Methods

  1. Generate address from pkBytes
func NewAddressFromPkBytes(pkBytes []byte, prefix string) (string, error)
  1. Generate address from pkHex
func NewAddressFromPKHex(pkHex, prefix string) (string, error)
  1. Generate address from pk
func NewAddressFromPK(pk bls.PublicKey, prefix string) (string, error)
  1. Get address from puzzleHash
GetAddressFromPuzzleHash(ph []byte, prefix string) (string, error)
  1. Get puzzleHash from address
func GetPuzzleHashFromAddress(address string) (string, []byte, error)

libs

  1. use https://github.com/chuwt/chia-bls-go to decode key
  2. modify https://github.com/btcsuite/btcutil/tree/master/bech32 to decode bech32

Buy me coffee

  • ETH: 0xdAdf173d0029dfABb64807686b04a1A1Bf6dc79e

About

generate a chia address by public key, chia公钥生成地址

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages