-
Notifications
You must be signed in to change notification settings - Fork 17
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
The application of blank node identifiers #10
Comments
The downside to the above solution is it effectively mandates the allocating of identifiers to blank nodes, i.e the signature suite would add node identifiers to all blank nodes to the data graph being signed. Which could be problematic for other suites signing the graph that do not have this requirement. It also un-intuitively adds a property to each blank node in the graph which could confuse some developers as to why it is present. |
An alternative is to provide a normative requirement that an id is supplied for each block. I think I prefer the method you proposed because it handles that for the caller which seems to be a better separation of concerns (returning an error because it can’t canonicalize seems odd). I'll have to think about it a bit more. |
The other option is to compute the blank node identifiers when deriving a proof. Deriving a proof takes in two inputs, the input proof document and the reveal document. Normalizing the input proof document will give us the original set of statements that were signed, including the correct blank node identifiers as the graph is identical to what was signed. We could elect to on the proof derivation, transform the blank node identifiers to proper node identifiers and return these in the derived proof, then on proof verification, the processing software would need to substitute the transformed blank node identifier (urn:bnid::c14n1) back into a normal blank node identifier (:c14n1) during normalization. As an example below. Given the input JSON-LD document to signed
Yields
For which we sign the normalized statement as is and return the following
Then when we want to derive a proof, say with the reveal document of
We would normalize the input proof to re-obtain the original normalized form
Diff the obtained statements with the statements we would like to reveal
Transform the blank node identifiers
Derive the proof and convert back to JSONLD giving the same output as before
But when we verify and have normalized the revealed statements again, e.g
We would need to process the relevant statements node identifiers back into normal blank node identifiers before verifying the proof e.g
|
Advantages and disadvantages of the two options Option 1 (Described in the original issue text) Advantages Disadvantages Option 2 Advantages Disadvantages |
I guess option 2 is better, moves the complexity from external to internal, always better to shoulder the burden than expose a quirk to library consumers... |
Ok option 2 it is for the time being! |
probably worth checking that some of the details needed for generating the blank nodes aren't lost/modified when doing proof generation based on the original VC. If this holds such that the verifier doesn't get bad signatures when verifying then I think option 2 is the better route as well. |
An alternative proposal suggested by @dlongley is to have a mapping for any BN identifiers in the proof to prevent the need for special skolem URIs (e.g This mapping must map the blank node identifiers allocated to the statements in the canonical form of the derivedProof back to what their blank node identifiers were in the originally signed proof. Because all blank nodes have a common prefix e.g How we express this in the proof we could do in one of two ways.
@dlongley is this an accurate summary of the idea you had in mind? |
@dlongley Ah interesting that would further simplify the representation, we will review that as an idea |
@dlongley did you have any thoughts on how this binary encoding should be done? I.e a custom binary format or should we be using a more formalised method like protocol buffers or message pack? The simplest custom way I see doing this would be something like the following
Where |
My vote for binary representations is CBOR. There is likely to be significant work in the future on CBOR-LD (including representing VCs using that format) and it would be best not to introduce yet another competing format with protocol buffers/etc. So whatever you guys come up with that makes sense in CBOR I would be +1 for. |
@TimoGlastra said during IIW that he was going to take this issue. |
@kdenhartog RE your note in #37. I just discovered you can only assign outside collaborators when they've commented. So here's my comment |
Can we fold this into #60? I am going to mark it bending close. |
Please see the updated document for mechanism details that address these concerns. See PR #101 for privacy considerations related to both data leakage and unlinkability, including analysis. |
In RDF canonicalisation/normalisation, one of the trickiest parts of the algorithm is dealing with blank nodes. RDF Data Set Normalisation defines a way in which to allocate identifiers for blank nodes deterministically for normalization.
However the algorithm does not guarantee that the same blank node identifiers will be allocated in the event of modifications to the graph.
For example
The following JSON-LD normalized
Yields
Where we have two blank nodes
_:c14n0
and_:c14n1
.If we then remove the address from the original JSON-LD i.e like below
We get different blank node identifiers for the same statements shown above.
Why is this a problem?
Because bbs-signatures aim to create selective disclosure of statements i.e revealing only a portion of the originally signed data graph and we must prove the integrity of revealed statements to show they were originally signed by the issuer.
Because we are often revealing only a subset of statements from the original, we must have a way in which guarantees that the node identifiers of the normalized statements being revealed match those that were originally signed.
Solution 1
When producing a BBS Signature we use the blank node identifier algorithm to allocate blank node identifiers, which we then transform into proper node identifiers, (E.g :c14n1 => urn:bnid::c14n1) for which we then sign the resulting statements, see below for an example.
Given the input JSON-LD document to signed
We normalize
Then transform any node identifiers to proper ones to get our input into signing
We then take the normalized from and cast it back to JSON-LD with the allocated blank node identifiers
This means when we are creating a sub-graph we have the allocated identifiers for the formerly blank nodes allocated.
E.g given the above digital signature, the following proof could be derived.
The text was updated successfully, but these errors were encountered: