This code demonstrates the following schemas. Sign functions signature are in GoLang, verifies are both in Golang and Solidity using Ethereum precompiled callbacks.
- Alice signs a message.
- Everyone verifies it using her public key.
- A group of participants sign a message.
- Their signatures are aggregated into one.
- Everyone verifies the aggregated signature using the aggregated public key.
- A subgroup of a group of participants sign a message.
- Their signatures are aggregated into one.
- Everyone verifies the aggregated signature using
- the aggregated signature,
- the aggregated public key of the subgroup (who really signed),
- the aggregated public key of all participants in the group (whether signed or not),
- the bitmap representing the subgroup (who really signed) - this is what accountable is.
- https://gist.github.com/BjornvdLaan/ca6dd4e3993e1ef392f363ec27fe74c4
- https://github.com/ConsenSys/gpact/blob/main/common/common/src/main/solidity/BlsSignatureVerification.sol
- https://github.com/keep-network/keep-core/blob/main/solidity/contracts/cryptography/AltBn128.sol
- Dan Boneh, Manu Drijvers, and Gregory Neven. Compact Multi-Signatures for Smaller Blockchains. https://crypto.stanford.edu/~dabo/pubs/abstracts/ASM.html
- BLS signatures: better than Schnorr. https://medium.com/cryptoadvance/bls-signatures-better-than-schnorr-5a7fe30ea716
- Dan Boneh, Victor Shoup. A Graduate Course in Applied Cryptography. Chapter 15: Elliptic curve cryptography and pairings. http://toc.cryptobook.us/
-
Install go compiller: v1.16+ https://golang.org/doc/install
-
Install solc: v0.8+ https://docs.soliditylang.org/en/v0.8.6/installing-solidity.html
-
Install abigen:
cd go-sol-bls make dep cd $GOPATH/pkg/mod/github.com/ethereum/go-ethereum@* make devtools
make test
Note that there are parameters specified in the [aggregated_test.go][test/aggregated_test.go] file that affect the gas usage:
MESSAGE_SIZE
- size of the message being signed in bytes,PARTICIPANTS_NUMBER
- total number of participants in a group who sign the message.