Proof of integrity on Polygon

Watch Certificate™
1 min readMar 10, 2023

--

Smart contract

Watch Certificate™ smart contract is available on this link:

https://polygonscan.com/address/0x14255bcDF743C884f614B2b60212F81AC744819a#readContract

PDF digest

For each certificate, a PDF including all the informations related to the watch gather during the watchmaker inspection and the expertise.

A watch can be updated, in that case the NFT linked is updated.

A SHA-256 represenation of the PDF file is stored on chain.

If someone tries to alter the PDF file, the Proof of Integrity will show that the certificate is corrupted.

Check PDF file integrity

In order to check the integrity of a certificate PDF file emitted by Watch Certificate™, you must hold the file.

On this link: https://nft.watchcertificate.org/:certificateCardId/verify-pdf you are able to upload your certificate and verify its integrity — don’t forget to add your Certificate ID.

With the contract and the file, you are able to compute a digest then compare it with the result from the function function pdfDigestWithCertificateCardId(string memory certificateCardId),

If digests are equals, the file is valid.

JSON digest

To check the integrity of a certificate JSON received by the Watch Certificate™ centralized backend, you must already got certificate ownership confirmed and access to its NFT representation.

A SHA-256 representation of the certificate JSON as owner is stored on chain.

As for the PDF, you should compute a digest with the JSON then compare it with the result (certificate.jsonDigest) of the function function certificateWithTokenId(uint256 tokenId), If digests are equals, the JSON is valid.

Find a more detailed version of this article on Watch Certificate™ technical documentation

--

--