From a80ed208735e73cc46801910fcfd65db34280f59 Mon Sep 17 00:00:00 2001 From: Lovesh Harchandani Date: Fri, 13 Apr 2018 17:08:15 -0700 Subject: [PATCH] Remove mistakenly merged files. Add code references, make title consistent across themis, remove reference to a meeting notes doc Signed-off-by: Lovesh Harchandani --- themis/cred-def.md | 6 +- themis/cred-offer.md | 7 +- themis/cred-request.md | 3 + themis/non-public-objects.md | 58 ----------- themis/proof-request.md | 4 + themis/proof.md | 5 +- themis/public-objects.md | 191 ----------------------------------- themis/zklang.md | 1 - 8 files changed, 21 insertions(+), 254 deletions(-) delete mode 100644 themis/non-public-objects.md delete mode 100644 themis/public-objects.md diff --git a/themis/cred-def.md b/themis/cred-def.md index 6ebf477..8f4efbc 100644 --- a/themis/cred-def.md +++ b/themis/cred-def.md @@ -92,5 +92,9 @@ When claims are issued and/or revoked, the revocation registry needs to be updat } ``` -## Code references to ledger objects +## Code references to ledger objects (some of below might be different from above mentioned structure, the above structure should be considered the correct representation) 1. [CLAIM_DEF](https://github.com/hyperledger/indy-sdk/blob/778a38d92234080bb77c6dd469a8ff298d9b7154/libindy/src/services/ledger/types.rs#L234) +2. [Primary public key](https://github.com/hyperledger/indy-crypto/blob/fc078a014a6b72ede838b79696258d3ee56f87d4/libindy-crypto/src/cl/mod.rs#L161) +3. [Revocation public key](https://github.com/hyperledger/indy-crypto/blob/fc078a014a6b72ede838b79696258d3ee56f87d4/libindy-crypto/src/cl/mod.rs#L202) +4. [Revocation Registry Definition](https://github.com/hyperledger/indy-crypto/blob/fc078a014a6b72ede838b79696258d3ee56f87d4/libindy-crypto/src/cl/mod.rs#L229) +5. [Revocation Registry Entry](https://github.com/hyperledger/indy-crypto/blob/fc078a014a6b72ede838b79696258d3ee56f87d4/libindy-crypto/src/cl/mod.rs#L249) \ No newline at end of file diff --git a/themis/cred-offer.md b/themis/cred-offer.md index 567912e..4fadaea 100644 --- a/themis/cred-offer.md +++ b/themis/cred-offer.md @@ -1,4 +1,4 @@ -# CRED_OFFER +# Credential Offer A credential offer is sent from an issuer to a potential holder. It communicates the type of credential on offer, and possibly its proposed @@ -13,4 +13,7 @@ credential is issued. ``` Credential offers sent to a potential holder are typically followed by -[credential request](cred-request.md) that flow the other direction. \ No newline at end of file +[credential request](cred-request.md) that flow the other direction. + +## Code reference (some of below might be different from above mentioned structure, the above structure should be considered the correct representation) +1. [Credential Offer](https://github.com/hyperledger/indy-sdk/blob/ad77c94a1116d2540bc6365cdb4f22ebfc899401/libindy/src/domain/credential_offer.rs#L7) diff --git a/themis/cred-request.md b/themis/cred-request.md index a37927f..f533c95 100644 --- a/themis/cred-request.md +++ b/themis/cred-request.md @@ -23,3 +23,6 @@ to them. ## Credential Notice When an issuer is making a change that affects its credential holders, it should let them know of the change. This could be because that the Issuer is updating its Credentials to a new schema, or rotating its public keys, or some breach was detected and credentials issued between a certain date period need to be reissued, or a particular credential was revoked (e.g, driver privileges suspended due to court order). This is done by sending the credential holder(s) a Credential Notice message. + +## Code reference (some of below might be different from above mentioned structure, the above structure should be considered the correct representation) +1. [Credential Request](https://github.com/hyperledger/indy-sdk/blob/ad77c94a1116d2540bc6365cdb4f22ebfc899401/libindy/src/domain/credential_request.rs#L12) \ No newline at end of file diff --git a/themis/non-public-objects.md b/themis/non-public-objects.md deleted file mode 100644 index 635a4b2..0000000 --- a/themis/non-public-objects.md +++ /dev/null @@ -1,58 +0,0 @@ -# Non Public Objects - -## Credential Offer -```json -{ - "schema_seq_no": "", - "issuer_did": "" -} -``` - - -## Credential Request -```json -{ - "data": { - "issuer_did": "", - "schema_seq_no": "", - "blinded_ms": { - "ur": "", - "u": "" - }, - "prover_did": "" - }, - "nonce": "" -} -``` - -## Proof Request -```json -{ - "name": "", - "version": "", - "attributes": { - "": "", - "": "", - "": "" - }, - "verifiableAttributes": "", - "nonce": "" -} -``` - -## Credential Notice -When an issuer is making a change that affects its credential holders, it should let them know of the change. This could be because that the Issuer is updating its Credentials to a new schema, or rotating its public keys, or some breach was detected and credentials issued between a certain date period need to be reissued, or a particular credential was revoked (e.g, driver privileges suspended due to court order). This is done by sending the credential holder(s) a Credential Notice message. - -## Proof -```json -{ - "msg_type": "proof", // required - "version": "0.1", // required - "to_did": "did:sov:BnRXf8yDMUwGyZVDkSENeq", // optional - "from_did": "did:btc:GxtnGN6ypZYgEqcftSQFnC", // optional - "proof_request_id": "cCanHnpFAD", - "proofs": { ... }, - "aggregated_proof": { ... }, - "requested_proof": { ... } -} -``` \ No newline at end of file diff --git a/themis/proof-request.md b/themis/proof-request.md index 07798ff..abfbd07 100644 --- a/themis/proof-request.md +++ b/themis/proof-request.md @@ -14,3 +14,7 @@ The message sent by the relying party to the holder describing the verifiable at "nonce": "" } ``` + + +## Code reference (some of below might be different from above mentioned structure, the above structure should be considered the correct representation) +1. [Proof Request](https://github.com/hyperledger/indy-sdk/blob/ad77c94a1116d2540bc6365cdb4f22ebfc899401/libindy/src/domain/proof_request.rs#L11) diff --git a/themis/proof.md b/themis/proof.md index 9c96bba..fcfcd9e 100644 --- a/themis/proof.md +++ b/themis/proof.md @@ -1,4 +1,4 @@ -# Proof Format +# Proof A proof is a JSON document that derives from one or more credentials. It demonstrates in a cryptographic/mathematical way that attributes within @@ -36,3 +36,6 @@ data is at rest. The formats of `proofs` and `aggregated_proof` are documented and governed by indy-sdk. + +## Code reference (some of below might be different from above mentioned structure, the above structure should be considered the correct representation) +1. [Proof](https://github.com/hyperledger/indy-sdk/blob/ad77c94a1116d2540bc6365cdb4f22ebfc899401/libindy/src/domain/proof.rs#L9) diff --git a/themis/public-objects.md b/themis/public-objects.md deleted file mode 100644 index 5325c4a..0000000 --- a/themis/public-objects.md +++ /dev/null @@ -1,191 +0,0 @@ -# Public Objects -The public objects are stored on the ledger as transactions. [This](https://github.com/hyperledger/indy-node/blob/master/docs/transactions.md) document describes the transactions. The objects described below are the desired format, the current format will soon be changed to the one mentioned below. ALso in the actual ledger transaction, the format described below will be wrapped in a `data` section and there will be one more section called `reqMetadata` that will contain metadata like the author of transaction, nonce for the transaction, etc. - -## Schema -Examples: -``` -{ - "name": "name", - "items": [ - {name: "first", element: , encoding: }, - {name: "middle", element: , encoding: }, - {name: "last", element: , encoding: } - ] -} - -{ - "name": "address", - "items": [ - {name: "line_1", element: , encoding: }, - {name: "line_2", element: , encoding: }, - {name: "line_3", element: , encoding: }, - {element: , encoding: }, - {name: "state", element: , encoding: }, - {element: , encoding: } - ] -} - -{ - "name": "work_address", - "spec": "address where subject is employed", - "items": [{schema:
, flatten: true}] -} - -{ - "name": "home_address", - "spec": "address where subject lives", - "items": [{schema:
, flatten: true}] -} - -{ - "name": "loan_application", - "spec": "application for a basic loan", - "items": [ - {schema: }, - {schema: }, - {schema: }, - … - ] -} -``` - -## Schema Elements -``` -first_name: {spec: "subject's first given name"} - -middle_name: {spec: "subject's other given names minus surname"} - -surname: {spec: "subject's surname"} - -address_line: {spec: "one line of a physical address"} - -city: {spec: "third line of a physical address"} - -us_state: {spec: "one of the states or territories of the USA"} - -zip_code: {spec: "US zip code"} - -birthdate: {spec: "date subject was born"} - -expires: {spec: "date credential expires"} - -driving_class: {spec: "US driving classification"} - -hair_color: {spec: "color of the subject's hair"} - -eye_color: {spec: "color of the subject's eyes"} - -weight: {spec: "subject's weight"} - -height: {spec: "subject's height"} - -corrective_lenses: {spec: "subject is required to wear corrective lenses"} - -daytime_only: {spec: "a subject's privilege is restricted to daytime"} -``` - -## Encodings -``` -since_1870: {spec: "date as a count of days since 1/1/1870"} - -us_driving_class: {spec: "US driving class; 'standard' -> 0, 'commercial' -> 1"} - -utf8_sha256: {spec: "SHA256 hash of string encoded as UTF-8"} - -alpha2: {spec: "two character abbreviation"} - -dpbc: {spec: "9 digit integer; 5 digit zip code encoded with trailing zeros; remove hyphen in zip+4; examples: '90210' -> 90210000, '90210-2222' -> 902102222"} - -hair_color_codes: {spec: "color of hair; bald -> "BA", black -> "BL, blonde -> "BE", brown -> "BR", gray -> "GR", red/auburn -> "RA", sandy -> "SA", unknown -> "UN", white -> "WH"} - -hair_color: {spec: "color of hair; 'bald' -> 9, 'black' -> 1, 'blonde' -> 2, 'brown' -> 3, 'gray' -> 4, 'red/auburn' -> 5, 'sandy' -> 6, 'unknown' -> 7, 'white' -> 8"} - -eye_color: {spec: "color of eyes; 'black' -> 0, 'blue' -> 1, 'brown' -> 2, 'dichromat' -> 3, 'gray' -> 4, 'green' -> 5, 'hazel' -> 6, 'maroon' -> 7, 'pink' -> 8, 'unknown' -> 9"} -weight_lbs: {spec: "weight in whole number of pounds (avoirdupois)"} - -weight_grams: {spec: "weight in whole number of grams"} - -length_half_inches: {spec: "length in whole number of half inches"} - -length_mm: {spec: "length in whole number of millimeters"} - -bool: {spec: "'true' -> 2, 'false' -> 1, 'unknown' -> 0"} -``` - -## Credential Definition -```json - "schemaId":21, // txn no of the schema - "sigType": "CL", - "publicKeys": { - // One or more public keys, one is described below below - }, -``` - -Public key -```json -{ - "rctxt": "", - "z": "", - "n": "", - "s": "", - "r": { - "": "", - "": "", - ... - } -} -``` - -## Revocation Registry Definition -```json -{ - "revocDefType":"type-3-pairing", - "credDefId":"", - "issuanceType": "", - "maxCredNum": 1000000, - "publicKeys": { - // One or more public keys, one is described below below - }, - "tailsHash": "", - "tailsLocation": "" -} -``` - -Public key -```json -{ - "y": "", - "pk": "", - "h": "", - "h0": "", - "h1": "", - "h2": "", - "htilde": "", - "hhat": "", - "g": "", - "gprime": "", - "u": "", - "qr": "", -} -``` -## Revocation Registry Entry -```json -{ - "revocRegDefId": "reference to the revocation registry definition", - "revocDefType":"type-3-pairing", - "prevAccum":"", - "accum":"", - "issued": [], (optional) - "revoked": [], -} -``` - - -## Code references to ledger objects -1. [NYM](https://github.com/hyperledger/indy-sdk/blob/778a38d92234080bb77c6dd469a8ff298d9b7154/libindy/src/services/ledger/types.rs#L43) -1. [ATTRIB](https://github.com/hyperledger/indy-sdk/blob/778a38d92234080bb77c6dd469a8ff298d9b7154/libindy/src/services/ledger/types.rs#L88) -1. [SCHEMA](https://github.com/hyperledger/indy-sdk/blob/778a38d92234080bb77c6dd469a8ff298d9b7154/libindy/src/services/ledger/types.rs#L144) -1. [CLAIM_DEF](https://github.com/hyperledger/indy-sdk/blob/778a38d92234080bb77c6dd469a8ff298d9b7154/libindy/src/services/ledger/types.rs#L234) -1. [NODE](https://github.com/hyperledger/indy-sdk/blob/778a38d92234080bb77c6dd469a8ff298d9b7154/libindy/src/services/ledger/types.rs#L300) -1. [POOL_CONFIG](https://github.com/hyperledger/indy-sdk/blob/778a38d92234080bb77c6dd469a8ff298d9b7154/libindy/src/services/ledger/types.rs#L457) -1. [POOL_UPGRADE](https://github.com/hyperledger/indy-sdk/blob/778a38d92234080bb77c6dd469a8ff298d9b7154/libindy/src/services/ledger/types.rs#L477) \ No newline at end of file diff --git a/themis/zklang.md b/themis/zklang.md index a8b76ed..48c6300 100644 --- a/themis/zklang.md +++ b/themis/zklang.md @@ -1,5 +1,4 @@ # ZKLang -__Taken from [ZKLang Meeting Notes](https://docs.google.com/document/d/1CwVljF8fS5NwF6NAppCvD4jLtH9t2m1rkut54hYGLm0/edit). That is a meeting notes doc so should not be referenced__ A typical interaction between an identity owner and relying party (which has asked for proof) looks like this. 1. Relying party asks for proof using Proof Request. 2. Identity owner examines the proof request and decides what credential definitions need to be used for creating the proof. The resulting object is called a proof resolution.