Skip to content

Commit

Permalink
docs: adjust selective disclosure example to use 5 attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
lanterno authored and lovesh committed Nov 28, 2024
1 parent 69c7a46 commit a8629ee
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,9 @@ to reveal his last name and city, but not any other attribute while proving that

```ts
// The attributes, [SSN, first name, last name, email, city]
const messages: Uint8Array[] = [...];
const messages: Uint8Array[] = [
"230-95-4628", "Harry", "Potter", "[email protected]", "Little Whinging"
].map(element => stringToBytes(element));

// Public values
const params: BBSSignatureParams;
Expand All @@ -475,17 +477,18 @@ const sig: BBSSignature = ...;
// i.e. attribute index 2 and 4 (indexing is 0-based), and the ones he wants to hide.
const revealedMsgIndices: Set<number> = new Set();
revealedMsgIndices.add(2);
revealedMsgIndices.add(3);
revealedMsgIndices.add(4);

// revealedMsgs are the attributes disclosed to the verifier
const revealedMsgs: Map<number, Uint8Array> = new Map();
revealedMsgs.set(2, messages[2]);
revealedMsgs.set(3, messages[3]);
revealedMsgs.set(4, messages[4]);

// unrevealedMsgs are the attributes hidden from the verifier
const unrevealedMsgs: Map<number, Uint8Array> = new Map();
unrevealedMsgs.set(0, messages[0]);
unrevealedMsgs.set(1, messages[1]);
unrevealedMsgs.set(1, messages[3]);
```

Since there is only 1 kind of proof, i.e. the knowledge of a BBS signature and the signed attributes, there would be only 1 `Statement`.
Expand Down

0 comments on commit a8629ee

Please sign in to comment.