chia-bls-signature in go, chia bls 签名工具go实现
2024/01/18 Thanks for the code from coolaj86,
a bug for checking length of pks on coreAggregateVerify
was fixed!
2023/07/08 Thanks for the report from goomario, a bug was fixed!
big.Int.Bytes()
, it should be replaced with big.Int.FillBytes()
go get github.com/chuwt/chia-bls-go
func KeyGenWithMnemonic(mnemonic, password string) PrivateKey
func KeyFromHexString(key string) (PrivateKey, error)
func KeyFromHexString(key string) (PrivateKey, error)
func (key PrivateKey) Bytes() []byte
func (key PrivateKey) Hex() string
func (key PrivateKey) FarmerSk() PrivateKey
func (key PrivateKey) PoolSk() PrivateKey
func (key PrivateKey) WalletSk(index int) PrivateKey
func (key PrivateKey) LocalSk() PrivateKey
func (key PrivateKey) SyntheticSk(hiddenPuzzleHash []byte) PrivateKey
func (key PrivateKey) GetPublicKey() PublicKey
func (key PublicKey) FingerPrint() string
func (key PublicKey) Bytes() []byte
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)