Presentation
Last updated
Last updated
list of credentials
list of credentials
Challenge can be used to match the response to a request
domain that will receive verifiable presentation
Response of presentation
Detail of presentaion that has created
const response = await fetch('/api/v1/presentation', {
method: 'POST',
headers: {
"Authorization": "Bearer JWT",
"Content-Type": "application/json"
},
body: JSON.stringify({
"credentialDocuments": [
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
{
"hs": "https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/schema/sch:hid:testnet:...........:1.0:"
},
{
"name": "hs:name"
},
"https://w3id.org/security/suites/ed25519-2020/v1"
],
"id": "vc:hid:testnet:......",
"type": [
"VerifiableCredential",
"nameschema"
],
"expirationDate": "2027-12-10T18:30:00Z",
"issuanceDate": "2027-12-10T18:30:00Z",
"issuer": "did:hid:testnet:..........",
"credentialSubject": {
"id": "did:hid:testnet:..............."
},
"credentialSchema": {
"id": "sch:hid:testnet:...............",
"type": "JsonSchemaValidator2018"
},
"credentialStatus": {
"id": "https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/credential/vc:hid:testnet:...............",
"type": "CredentialStatusList2017"
},
"proof": {
"type": "Ed25519Signature2020",
"created": "2023-01-25T17:01:02Z",
"verificationMethod": "did:hid:testnet:...............#key-${id}",
"proofPurpose": "assertionMethod",
"proofValue": "z5LairjrBYkc5FtP.......................EXFHm37aDvcMtCvnYfmvQ"
}
}
],
"holderDid": "did:hid:testnet:............",
"challenge": "skfdhldklgjh-gaghkdhgaskda-aisgkjheyi",
"domain": "example.com"
}),
});
const data = await response.json();
{
"presentation": {
"@context": [
"https://www.w3.org/2018/credentials/v1"
],
"type": [
"VerifiablePresentation"
],
"verifiableCredential": [
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
{
"hs": "https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/schema/sch:hid:testnet:...........:1.0:"
},
{
"name": "hs:name"
},
"https://w3id.org/security/suites/ed25519-2020/v1"
],
"id": "vc:hid:testnet:......",
"type": [
"VerifiableCredential",
"nameschema"
],
"expirationDate": "2027-12-10T18:30:00Z",
"issuanceDate": "2027-12-10T18:30:00Z",
"issuer": "did:hid:testnet:..........",
"credentialSubject": {
"id": "did:hid:testnet:..............."
},
"credentialSchema": {
"id": "sch:hid:testnet:...............",
"type": "JsonSchemaValidator2018"
},
"credentialStatus": {
"id": "https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/credential/vc:hid:testnet:...............",
"type": "CredentialStatusList2017"
},
"proof": {
"type": "Ed25519Signature2020",
"created": "2023-01-25T17:01:02Z",
"verificationMethod": "did:hid:testnet:...............#key-${id}",
"proofPurpose": "assertionMethod",
"proofValue": "z5LairjrBYkc5FtP.......................EXFHm37aDvcMtCvnYfmvQ"
}
}
],
"id": "vp:hid:testnet:..........................",
"holder": "did:hid:testnet:..............",
"proof": {
"type": "Ed25519Signature2020",
"created": "2023-01-25T17:01:02Z",
"verificationMethod": "did:hid:testnet:...............#key-${id}",
"proofPurpose": "authentication",
"challenge": "skfdhldklgjh-gaghkdhgaskda-aisgkjheyi",
"proofValue": "z5LairjrBYkc5FtPWeDVuLdQUzpMTBULcp3Q5YDnrLh63UuBuY6BpdiQYhTEcKBFW76TEXFHm37aDvcMtCvnYfmvQ"
}
}
}
Challenge can be used to match the response to a request
did of the verifier
templateId of the presentation templete to form presentation request
expiresTime for the presentation request (unix timestamp)
callbackUrl that will receive verifiable presentation
Presentation request is created
id of presentation request template
did of the holder
Time of request creation
Time at which challenge become invalid
Url that will receive verifiable presentation
list of dids to whome presentationis to be given
Presentatioin template detail
const response = await fetch('/api/v1/presentation/request', {
method: 'POST',
headers: {
"Authorization": "Bearer JWT",
"Content-Type": "application/json"
},
body: JSON.stringify({
"challenge": "skfdhldklgjh-gaghkdhgaskda-aisgkjheyi",
"did": "did:hid:<namespace>:...............",
"templateId": "6392854982......",
"expiresTime": 1231423,
"callbackUrl": "https://example.com/verify/callback"
}),
});
const data = await response.json();
{
"id": "f....8-84ae-4..2-a..3-efab....d4db",
"from": "did:hid:testnet:...............",
"created_time": 1675167388737,
"expires_time": 1675177277551,
"reply_url": "https://example.com/verify/callback",
"reply_to": [
"did:hid:testnet:................."
],
"body": {
"appId": "43...18-...........",
"domain": "fyre.hypersign.id",
"query": [
{
"type": "QueryByExample",
"credentialQuery": [
{
"required": true,
"reason": "We need you to prove your eligibility to work.",
"example": {
"@context": [
"https://www.w3.org/2018/credentials/v1"
],
"type": "AlumniCredential",
"credentialSubject": {
"name": "Random name",
"id": "did:hid:testnet:............................."
},
"credentialSchema": {
"id": "sch:hid:testnet:...............",
"type": "JsonSchemaValidator2018"
},
"trustedIssuer": [
{
"required": true,
"issuer": "did:hid:testnet:................"
}
]
}
}
]
}
]
}
}
list of credentials
presentation verification done successfully
resul of verification
detailed information of verification
verification result of credential
const response = await fetch('/api/v1/presentation/verify', {
method: 'POST',
headers: {
"Authorization": "Bearer JWT",
"Content-Type": "application/json"
},
body: JSON.stringify({
"presentation": {
"@context": [
"https://www.w3.org/2018/credentials/v1"
],
"type": [
"VerifiablePresentation"
],
"verifiableCredential": [
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
{
"hs": "https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/schema/sch:hid:testnet:...........:1.0:"
},
{
"name": "hs:name"
},
"https://w3id.org/security/suites/ed25519-2020/v1"
],
"id": "vc:hid:testnet:......",
"type": [
"VerifiableCredential",
"nameschema"
],
"expirationDate": "2027-12-10T18:30:00Z",
"issuanceDate": "2027-12-10T18:30:00Z",
"issuer": "did:hid:testnet:..........",
"credentialSubject": {
"id": "did:hid:testnet:..............."
},
"credentialSchema": {
"id": "sch:hid:testnet:...............",
"type": "JsonSchemaValidator2018"
},
"credentialStatus": {
"id": "https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/credential/vc:hid:testnet:...............",
"type": "CredentialStatusList2017"
},
"proof": {
"type": "Ed25519Signature2020",
"created": "2023-01-25T17:01:02Z",
"verificationMethod": "did:hid:testnet:...............#key-${id}",
"proofPurpose": "assertionMethod",
"proofValue": "z5LairjrBYkc5FtP.......................EXFHm37aDvcMtCvnYfmvQ"
}
}
],
"id": "vp:hid:testnet:..........................",
"holder": "did:hid:testnet:..............",
"proof": {
"type": "Ed25519Signature2020",
"created": "2023-01-25T17:01:02Z",
"verificationMethod": "did:hid:testnet:...............#key-${id}",
"proofPurpose": "authentication",
"challenge": "skfdhldklgjh-gaghkdhgaskda-aisgkjheyi",
"proofValue": "z5LairjrBYkc5FtPWeDVuLdQUzpMTBULcp3Q5YDnrLh63UuBuY6BpdiQYhTEcKBFW76TEXFHm37aDvcMtCvnYfmvQ"
}
}
}),
});
const data = await response.json();
{
"verified": true,
"results": [
{
"@context": [
"https://www.w3.org/2018/credentials/v1"
],
"type": [
"VerifiablePresentation"
],
"verifiableCredential": [
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
{
"hs": "https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/schema/sch:hid:testnet:...........:1.0:"
},
{
"name": "hs:name"
},
"https://w3id.org/security/suites/ed25519-2020/v1"
],
"id": "vc:hid:testnet:......",
"type": [
"VerifiableCredential",
"nameschema"
],
"expirationDate": "2027-12-10T18:30:00Z",
"issuanceDate": "2027-12-10T18:30:00Z",
"issuer": "did:hid:testnet:..........",
"credentialSubject": {
"id": "did:hid:testnet:..............."
},
"credentialSchema": {
"id": "sch:hid:testnet:...............",
"type": "JsonSchemaValidator2018"
},
"credentialStatus": {
"id": "https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/credential/vc:hid:testnet:...............",
"type": "CredentialStatusList2017"
},
"proof": {
"type": "Ed25519Signature2020",
"created": "2023-01-25T17:01:02Z",
"verificationMethod": "did:hid:testnet:...............#key-${id}",
"proofPurpose": "assertionMethod",
"proofValue": "z5LairjrBYkc5FtP.......................EXFHm37aDvcMtCvnYfmvQ"
}
}
],
"id": "vp:hid:testnet:..........................",
"holder": "did:hid:testnet:..............",
"proof": {
"type": "Ed25519Signature2020",
"created": "2023-01-25T17:01:02Z",
"verificationMethod": "did:hid:testnet:...............#key-${id}",
"proofPurpose": "authentication",
"challenge": "skfdhldklgjh-gaghkdhgaskda-aisgkjheyi",
"proofValue": "z5LairjrBYkc5FtPWeDVuLdQUzpMTBULcp3Q5YDnrLh63UuBuY6BpdiQYhTEcKBFW76TEXFHm37aDvcMtCvnYfmvQ"
}
}
],
"credentialResults": [
{
"verified": true,
"results": [
{
"proof": {
"type": "Ed25519Signature2020",
"created": "2023-01-25T17:01:02Z",
"verificationMethod": "did:hid:testnet:...............#key-${id}",
"proofPurpose": "assertionMethod",
"proofValue": "z5LairjrBYkc5FtP.......................EXFHm37aDvcMtCvnYfmvQ",
"Context": [
"https://www.w3.org/2018/credentials/v1",
{
"hs": "https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/schema/sch:hid:testnet:z3KX4ZqoizKTaED645aV4aE8dBbnSpmQYe3xfzVBJadPY:1.0:"
},
{
"name": "hs:name"
},
"https://w3id.org/security/suites/ed25519-2020/v1"
]
},
"verified": true,
"verificationMethod": {
"id": "did:hid:testnet:................................#key-${id}",
"type": "Ed25519VerificationKey2020",
"controller": "did:hid:method:..............",
"publicKeyMultibase": "z28ScfSszr.............j8nCwx4DBF6nAUHu4p"
},
"purposeResult": {
"valid": true
}
}
],
"statusResult": {
"verified": true
},
"credentialId": "vc:hid:testnet:......"
}
]
}