verify_timestamp: Verify a timestamp of a hash

View source: R/verify_timestamp.R

verify_timestampR Documentation

Verify a timestamp of a hash

Description

There are effectively two ways of verifying a timestamp of a hash:

Usage

verify_timestamp(
  x,
  proof = NULL,
  use_originstamp = is.null(proof),
  error_on_fail = TRUE,
  url = api_url(),
  key = api_key()
)

Arguments

x

x an R object (character vector containing file names of existing files or strings) of which a hash will be calculated using the function hash(x). The object whose timestamp should be verified

proof

either a file name or an URL pointing to the proof or certificate of the timestamp

use_originstamp

if TRUE, OriginStamp will be used to verity the timestamp of the hash. In this case, proof is not needed.

error_on_fail

if TRUE, raise error when api call fails, otherwise return the failed response.ß

url

the url of the api. The default is to use the url as returned by the function api_url()

key

the api key. The default is to use the key as returned by the function api_key()

Details

  1. to use OriginStamp. This is the easies approach and is described on their documentation site. Similarly, when specifying use_originstamp = TRUE the api will be used to retrieve information about the timestamp using the get_hash_status() function.

  2. to not use OriginStamp. This directly queries the bitcoin blockchain. The host used to verify without the proof is not available anymore. Therefore this part does not work anymore. It is only included as an example how it could be done using a different host

For this, it is essential to have either the xml proof or the pdf certificate of the timestamp as can be downloaded by the function extract_proof(). Here, we assume that all verification should be done without any interaction with OriginStamp. Only timestamps issued after middle February 2021 can be veryfied using this approach (OP_RETURN usage by OriginStamp.

Value

data.frame with currency_id, transaction and timestamp if verification was successful. Otherwise these are all set to NULL.


rkrug/ROriginStamp documentation built on Aug. 16, 2022, 5:45 p.m.