-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Add wrapper for BLS from Chia Network #72
Conversation
And fix a bug in `aggregate_signatures`: make sure bytes are converted to `bls_chia.Signature`
CI fails due to the lack of CMake, but installing CMake and building result in much more time.(Though it can be mitigated with the cache in circle CI). I'm considering whether |
Worth thinking about experimenting w/ the code linked in #73 |
Agree! It looks pretty interesting. I think both C and pure Python worth our trying, too. |
Making use of `InsecureSignature.aggregate`
Don't add 1 to the `private_key`. The range of private key should be (0, curve_order - 1].
Moved to trinity in ethereum/trinity#708 |
What was wrong?
Fixes #71. I will use "BLS chia" as the alias of Chia network's BLS implementation, along with its python bindings in the following paragraphs.
How was it fixed?
sign
,privtopub
,verify
,aggregate_signatures
,aggregate_pubkeys
,aggregate_multiple
with BLS chia.tests/test_bls.py
totests/test_bls_chia.py
and test with those functions.scripts/benchmark_api.py
, which is mostly inspired by Benchmark #69.Problems
1
.RuntimeError: Caught an unknown exception!
if the source signatures are initialized withblspy.Signature.from_bytes
. This issue is really hard to debug since no further information is printed from the C++ side. Currently, I workaround it through adding a_sig_map: Dict[bytes, bls_chia.Signature] = {}
, which memoizes all signatures generated throughsign
andaggregate_signatures
, to avoid the issue resulting fromSignature.from_bytes
. Ref: Potential bug in Signature deserialization and aggregation using Python Chia-Network/bls-signatures#54Example benchmark
Run
number=100
times withtimeit
, with20
keys and signatures aggregated. Need to further try the other parameters, and understand the meanings of the result.To make use of the script with custom implementations:
api.py
with functionsprivtopub
,verify
,aggregate_signatures
,aggregate_pubkeys
,verify_multiple
.api.py
under a package with your custom name, says "bls_another", underpy_ecc
, sopy_ecc/bls_another/api.py
.python py_ecc/scripts/benchmark_api.py bls_another
.Cute Animal Picture