- Notifications
You must be signed in to change notification settings - Fork16
chia-bls-signature in go, chia bls 签名工具go实现
License
NotificationsYou must be signed in to change notification settings
chuwt/chia-bls-go
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
- go版本chia签名, 参考python-impl实现部分功能,并非bls的完全实现
2024/01/18 Thanks for thecode fromcoolaj86,a bug for checking length of pks on
coreAggregateVerify
was fixed!2023/07/08 Thanks for thereport fromgoomario,a bug was fixed!
- This bug was caused by the wrong use of
big.Int.Bytes()
, it should be replaced withbig.Int.FillBytes()
- This bug was caused by the wrong use of
- 生成私钥
- 助记词
- seed
- hexString
- bytes
- 签名
- 验签
- 多签
- 多签验证
go get github.com/chuwt/chia-bls-go
- 助记词加载
func KeyGenWithMnemonic(mnemonic, password string) PrivateKey
- hex string加载
func KeyFromHexString(key string) (PrivateKey, error)
- bytes加载
func KeyFromHexString(key string) (PrivateKey, error)
- 生成bytes
func (key PrivateKey) Bytes() []byte
- 生成hex string
func (key PrivateKey) Hex() string
- 派生farmerSk
func (key PrivateKey) FarmerSk() PrivateKey
- 派生poolSk
func (key PrivateKey) PoolSk() PrivateKey
- 派生walletSk
func (key PrivateKey) WalletSk(index int) PrivateKey
- 派生localSk
func (key PrivateKey) LocalSk() PrivateKey
- 生成SyntheticSk
func (key PrivateKey) SyntheticSk(hiddenPuzzleHash []byte) PrivateKey
- 生成公钥
func (key PrivateKey) GetPublicKey() PublicKey
- 生成指纹(fingerprint)
func (key PublicKey) FingerPrint() string
- 生成bytes
func (key PublicKey) Bytes() []byte
- 生成hex string
func (key PublicKey) Hex() string
- 签名
func (asm *AugSchemeMPL) Sign(sk PrivateKey, message []byte)
- 验证
func (asm *AugSchemeMPL) Verify(pk PublicKey, message []byte, sig []byte) bool
- 多签
// 将多个签名联合在一起func (asm *AugSchemeMPL) Aggregate(signatures ...[]byte) ([]byte, error)
- 多签验证
// 公钥数组,原始信息数组,多签返回的数据func (asm *AugSchemeMPL) AggregateVerify(pks [][]byte, messages [][]byte, sig []byte) bool
- 前置公钥签名
// 前置公钥签名SignWithPrependPK(sk PrivateKey, prependPK PublicKey, message []byte)
About
chia-bls-signature in go, chia bls 签名工具go实现
Topics
Resources
License
Stars
Watchers
Forks
Packages0
No packages published