Skip to content
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

BBS+ Verifier Contract #1

Merged
merged 13 commits into from
Nov 5, 2024
Merged

BBS+ Verifier Contract #1

merged 13 commits into from
Nov 5, 2024

Conversation

man2706kum
Copy link
Collaborator

This PR includes the solidity verifier contract for BBS+ signature verification. The following function is implemented:

  • expandMsgTo48: converts arbitrary byte msg to fixed 48 bytes. Also required for bn254 hash-to-curve
  • from_okm which takes a bigint number n as 48 byte msg and does n (mod p) where p is scalar prime
  • hashToScalar: converts arbitrary byte msg to bn254 scalar
  • calculate_domain: calculates the domain scalar from public key and generators as mentioned in BBS Draft
  • verifySignature: verifies the BBS+ signature
  • All the bn254 add, scalar_mul and pairing operation used the bn254 precompile
  • There are 32 generators generated in pseudo-random manner and are hardcoded in the contract. That means the upper bound on number of messages is 32-1 = 31

@man2706kum man2706kum self-assigned this Sep 12, 2024
@man2706kum man2706kum merged commit a709938 into main Nov 5, 2024
3 checks passed
@man2706kum man2706kum deleted the bbs_verify branch November 5, 2024 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants