Appearance
BBS DID Scheme - Holographic Overview
BBS Signature Scheme (Chinese)
System Architecture
- User: The user who wants to obtain a credential (passport) to access a DApp.
- Issuer: An on-chain contract deployed by the DApp on the origin chain, which can mint a soulbound token (ERC-5114 / ERC-5484, revocable by the Issuer) to the User on the destination chain.
- Signer: An off-chain Trusted Third Party (TTP) service provider that verifies user information and issues BBS signatures.
- Verifier: A contract deployed by the DApp/Signer that verifies the NIZK proof and triggers a callback to the Issuer contract to mint the token. Can be deployed on different chains to minimize verification costs.(Reactive Network)
Prelude
Message coding definition:
| Message ID | Message contents |
|---|---|
| Constrain1, e.g., "Is_Adult=1" | |
| Constrain2, e.g., "keccak(nationality)=keccak("CN")" | |
| Constrain3, ... | |
| Constrain4, ... | |
| Expiration Height | |
| Nullifier commitment | |
| Blind factor |
1. Init
Issuer generates unique
and encodes it in the contract. Signer runs
to get private key and publishes the public key . Signer or Issuer deploys the Verifier contract and embeds
and into the contract.
NOTE
Current status
- Public:
- Signer:
- Signer:
2. User apply
User
Use
viewfunction to readand the requirements of DApp on chain. Sample
, compute: - Nullifier hash:
- Nullifier commitment:
- Bind the commit:
- Nullifier hash:
Send
to Verifier Contract to stash it on chain ( KeyExist[mapping(uint=>bool)][N]] = true) by using a new address. Aggregate the constraints
. Send
to Signer.
NOTE
Current status
- Public:
- Verifier:
- Verifier:
- Signer:
, - User:
3. Signer gen signature
Signer
- Check whether the user's info corresponds to the constraints in
. If not, refuse to sign. - Compute 1st commitment:
- Generate 1st signature
where:
- Use same
to generate 2nd signature where:
- Send signature
back to User.
- Check whether the user's info corresponds to the constraints in
NOTE
Current status
- Public:
- Verifier:
- Verifier:
- Signer:
, - User:
,
4. User gen NIZK proof
User
- Unnlind the
:
- Reconstruct the signature
:
- Generate NIZK proof
to prove knowledge of a valid signature for messages while hiding .
Let
(public message indices), while is the hidden message. where:
(randomized signature point) (FS transform) , (responses for )
- Send
to Verifier.
- Unnlind the
NOTE
Current status
- Public:
- Verifier:
- Verifier:
- Signer:
, - User:
5. Verify the Signature and mint the token
Verifier
- Compute public part commitment (pre-computed since constraints are hard-coded):
where
(public message indices). Verify nullifier pre-commitment:
- Compute
- Require
KeyExist[N] == true(check pre-committed in Step 2) - Require
Used[N] == false(prevent double-spending)
- Compute
Verify the NIZK proof
: - Recompute the Fiat-Shamir challenge (note:
is included in as it's revealed):
- Pairing check (verify randomized signature is valid):
- Homomorphic check (verify correct representation of
with hidden ):
If any check fails, revert.
- Recompute the Fiat-Shamir challenge (note:
Mark nullifier as used:
- Set
Used[N] = true
- Set
Call the Issuer's function
mint(timestamp, 0xUserAddr)to issue the soulbound token to0xUserAddr.
6. Summary
Features
- [x] Unforgeability: Only the Signer with secret key
can generate valid signatures. - [x] Unlinkability: The Signer cannot track where the User uses the signature because:
- The NIZK proof is randomized (
with fresh each time) - The Signer only sees
, even though is revealed at spend time and holds the realtion of simutanuesly, the Signer should iterate every possible and to track the User.
- The NIZK proof is randomized (
- [x] Single-use: The User cannot use the same signature multiple times because:
is pre-committed before signing - Verifier checks and marks
as used atomically
- [x] Privacy:
(blind factor) is hidden via zero-knowledge in the proof - Signature
is hidden via randomization
- [x] Domain separation: The
parameter in Fiat-Shamir transform prevents proof replay across different DApps. - [x] Expiration: The token could be burn after a specified block height (encoded in
, e.g.) to limit the validity period of the credential, or a real-world time by aquiring the current time from a external oracle.
Extensions
- [x] Multiple signatures: ...
- [x] The length of the Messages: the
could be freely extended by adding more in the public parameters and encoding more constraints in the signature. - [x] Support Timed Encryption?: When the User gen
, the User could use RSW to encrypt to feature and gen a zk-proof, so the Verifier could aquire after some time delay and eventually link the VC to the exact User. - [x] Support zkvm?: The User could utilize the zkvm network to compress the proof into only one groth16 proof and minimize the on-chain verification cost.
Remaining Issues
- [ ] Signature malleability: The basic BBS signature
is susceptible to forgery for commitment . To solve this, we should consider using BBS+. - [ ] Nullifier waste: User commits
before receiving signature. If Signer refuses, the nullifier is wasted.