Skip to content

Latest commit

 

History

History
102 lines (77 loc) · 3.71 KB

WebPageTimestamp.md

File metadata and controls

102 lines (77 loc) · 3.71 KB

WebPageTimestamp

Current Version: 0.2.0

Changelog

0.2.0

  • Draft of WebPageTimestamp based on ArticleTimestamp 0.2.0.

Creating the hash

The hash that is put into the blockchain is generated by hashing a JSON object containing properties and attributes. Currently, the hashing algorithm used is SHA-256.

{
  "type": "WebPageTimestamp",
  "version": "0.2.0",
  "title": "My Blog Title",
  "content": "Lorem Ipsum",
  "date": "2019-07-08T08:38:23+0000"
}

The SHA-256 hash of the minified JSON example is 064a4891a5e2d0fd08914f08acaff78a91122b36a6dcdc97a4b8f3de7105a089. This hash needs to be posted to the blockchain. The transaction id of the transaction that is included in the blockchain, which contains this hash, needs to be saved together with the used properties and attributes.

Properties

Properties are required fields for every WebPageTimestamp.

type - String, The type used

version - String, The version of the type used

name - String, Text

date - String, ISO 8601, the last date of the item being modified in the source before timestamping it

Attributes

Attributes can be included, but are optional. Only items included in the standard can be added to the JSON object, in alphabetical order, after the last property. If the value of an attribute is empty, it should not be included in the object.

previousVersion - String, SHA256. The hash of the previous version of the current post.

url - String, Text

Including into DOM

It should be clear how and what data was used when generating the hash. We are using JSON-LD to declare the variables that were used for creating the JSON object and include our generated hash and information of the blockchain which contains this hash.

With the included information in the JSON-LD object, third-parties can compare their and your results themselves.

A WebPageTimestamp can contain other objects of the same type, which are referred to as revisions. The parent object always contains information about the most recent version of the web page.

<script type="application/ld+json">
{
  "@context": {
    "@type": "WebPageTimestamp",
    "@version": "0.2.0"
  },
  "blockchain": "eos",
  "transactionId": "77ac208d9a01d0cf40345786da28accd2795f5a6a6cf3692168a2a71ca165708",
  "hash": "8A258E516081C36B866812E49495628CBDC1DD4126DB321A28AE95EE55B83BAB",
  "name": "My Blog Title",
  "dateModified": "2019-07-08T08:38:23+0000",
  "previousVersion": "2DAD3812C721EF4A21541CCF1DB7C54BA1643294162B038ACDE8CF1CE7DA511B",
  "revisions": [
    {
      "@context": {
        "@type": "WebPageTimestamp",
        "@version": "0.2.0"
      },
      "blockchain": "eos",
      "transactionId": "a4ce94cc4c0adda8075ac133b4de884a282e3de4ee1734d808a2e9737e06f5a1",
      "hash": "2DAD3812C721EF4A21541CCF1DB7C54BA1643294162B038ACDE8CF1CE7DA511B",
      "name": "My Blog Title",
      "dateModified": "2019-06-08T08:38:23+0000",
      "previousVersion": "3BD952F0459160463C502C86DA7ABD80A857207F8A1ED2D3B7A38B438CA0D071"
    },
    {
      "@context": {
        "@type": "WebPageTimestamp",
        "@version": "0.2.0"
      },
      "blockchain": "eos",
      "transactionId": "b5832cb36421e0c2a49e4250b906021b340c07e24ce4c22156cf7d7cbf9a1254",
      "hash": "3BD952F0459160463C502C86DA7ABD80A857207F8A1ED2D3B7A38B438CA0D071",
      "name": "My Blog Title",
      "dateModified": "2019-05-08T08:38:23+0000"
    }
  ]
}
</script>

Including to blockchain

The implementation will differ per blockchain. Please include the following fields.

hash - String, SHA-256 hash of the web page previousTransactionId - Optional, String - Blockchain Transaction Id with hash of the previous revision.

Optionally you can include a memo including an url to enhance the user experience.