Comments (8)
HI @ssho0508,
I'm not sure I can exactly replicate the issue as it seems related to your data. This is where the hash is computed for the verifier: https://github.com/blockchain-certificates/cert-verifier-js/blob/master/src/inspectors/computeLocalHash.ts
You may want to see what's actually normalized by jsonld on the issuer and on the verifier side, as this will likely give you more insights as to what the potential issue can be.
from cert-verifier-js.
Also at this moment this package is made to work with node 16. I'm in the process of upgrading a few things and make sure it works with node 18 but I'm not 100% it works as expected at this time.
from cert-verifier-js.
Thanks for the reply!
I will try to use the node 16 to debug and I think maybe I make something wrong when I used the cert-tool to make a unsigned-credential. I found that the computeLocalHash is using the @context
to hash. and I'm not sure whether I make wrong with adding custom fields. Forgive my stupid.
"@context": [
"https://www.w3.org/2018/credentials/v1",
{
"test": {
"@id": "schema:description"
},
"alumniOf": {
"@id": "schema:description"
},
"evidence": {
"@id": "schema:description"
},
"nonce": {
"@id": "schema:description"
}
},
"https://w3id.org/blockcerts/v3"
],
"type": [
"VerifiableCredential",
"BlockcertsCredential"
],
"issuer": "http://localhost:7000/profile",
"issuanceDate": "2023-07-03T01:53:06Z",
"id": "urn:uuid:0e2c5a42-a400-4042-864f-08cd064760d4",
"credentialSubject": {
"id": "ecdsa-koblitz-pubkey:mkwntSiQmc14H65YxwckLenxY3DsEpvFbe",
"alumniOf": {
"id": "http://localhost:7000/profile"
},
"evidence": "test M"
},
"nonce": "kim custom subtitle",
"test": "mg"
}
from cert-verifier-js.
I don't think you are stupid, jsonld is not too straightforward.
If you are going to redefine some terms, I suggest you try with the JSONLD playground: https://fhircat.org/jsonld/playground/, that way you can try and adjust your definitions so that they are correclty picked up.
However both the issuer and the verifier should normalize the document the same way before hashing so I'm not entirely sure the problem is laying around your context definition.
from cert-verifier-js.
You'll want to print this: https://github.com/blockchain-certificates/cert-verifier-js/blob/master/src/inspectors/computeLocalHash.ts#L52
from cert-verifier-js.
That's exactly what I need!
I found that it's because the "evidence": "test M"
can not be hashed by cert-issuer and it can be hashed by cert-verifier-js.
Anyway, I make it by moving the "evidence": "test M"
outside or just drop it.
Thank you for you help!
from cert-verifier-js.
Ok I think I need to investigate why there is a difference in normalization in cert-issuer
from cert-verifier-js.
Sorry to bother you again.
I found the "evidence" has been defined in "https://www.w3.org/2018/credentials/v1" and that's what make the difference.
I change it to other names like testCredential and the hashes of both sides are the same.
So the normalization is different, but there is a way to avoid it.
Thank you!
from cert-verifier-js.
Related Issues (20)
- Build tests for v3 certs do not work
- The address used to issue this Blockcerts does not belong to the claimed issuer HOT 22
- Node build is broken
- Update deps base58-universal / transmute/did-core
- The "postinstall" script fails on Windows system HOT 4
- cache-control is not allowed by Access-Control-Allow-Headers in preflight response HOT 1
- hostOrText.readFile is not a function while npm run build HOT 2
- Does the cert-verifier-js support the DID without publicKeyJWK?
- eth sepolia verification failed HOT 7
- Failed JSON-LD normalization HOT 8
- ERROR XMLHttpRequest HOT 1
- Add the ability to specify custom chain HOT 3
- keyPropertyName/key pair is not appended to the URL querystring on verify again HOT 1
- BTC testnet validations fail due to out-of-date URL HOT 2
- Feature: Allow to pass assertionId as query parameter to the revocationList request
- Migrate JSONLD dep to v5
- Extract checkForUnmappedFields logic and apply it all versions
- Cert Verifier with external explorer APIs - Issue HOT 5
- create test scaffholding for quick browser and node build check
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cert-verifier-js.