Skip to content

BbsBlsSignature : Selective Disclosure #15

Open
@marc4virono

Description

@marc4virono

Hi,

I am interested to do some selective disclosure by using the Bbs algorithm.
I noticed that this Bbs/Bls feature is not supported by your library. So I am trying to implement it.

Are you agree if I do this :

  1. I create a byte[][] for the result of canonicalization function and it will contain the hash of each canonicalized attribute
    Example :
// The result of the json-ld after the canonicalization
// each line will be hashed (byte[i] = sha256(line[i]_bellow)) with sha256 return an array of byte
<did:example:ebfeb1f712ebc6f1c276e12ec21> <http://schema.org/familyName> "Sporny" .
<did:example:ebfeb1f712ebc6f1c276e12ec21> <http://schema.org/givenName> "Manu" .
<did:example:ebfeb1f712ebc6f1c276e12ec21> <https://example.org/examples#college> <did:example:c276e12ec21ebfeb1f712ebc6f1> .
<http://example.edu/credentials/1872> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://example.org/examples#UniversityDegreeCredential> .
<http://example.edu/credentials/1872> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.w3.org/2018/credentials#VerifiableCredential> .
<http://example.edu/credentials/1872> <https://www.w3.org/2018/credentials#credentialSubject> <did:example:ebfeb1f712ebc6f1c276e12ec21> .
<http://example.edu/credentials/1872> <https://www.w3.org/2018/credentials#issuanceDate> "2010-01-01T19:73:24Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
<http://example.edu/credentials/1872> <https://www.w3.org/2018/credentials#issuer> <https://example.edu/issuers/565049> .
  1. I reproduce the same thing for the ld-proof
  2. I edit all the class to call the signing function.
    The 'messages' is the result of the canonicalization (byte[][])
Bbs.blsSign(this.getPrivateKey().secretKey, this.getPrivateKey().publicKey, messages);

  1. To do some selective disclosure I will do this
        byte[] nonce = getNonce();
        byte[][] messages = getMessages(); //
        byte[] publicKey = getPublicKey();
        byte[] signature = getSignature();

        ProofMessage[] proofMessage = {
                //if("to reveal")
                new ProofMessage(ProofMessage.PROOF_MESSAGE_TYPE_REVEALED, messages[i], new byte[0]),
                //else("to hide")
                // new ProofMessage(ProofMessage.PROOF_MESSAGE_TYPE_HIDDEN_PROOF_SPECIFIC_BLINDING, messages[i], new byte[0]),
        };

        byte[] proof = new byte[0];
        byte[] bbsPublicKey = Bbs.blsPublicToBbsPublicKey(publicKey, messages.length);

        try {
            proof = Bbs.createProof(bbsPublicKey, nonce, signature, proofMessage);
        } catch (Exception exception) {
            exception.printStackTrace();
        }

Best regards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions