alan-turing-institute / trustchain

Trustworthy decentralised PKI
https://alan-turing-institute.github.io/trustchain/
Apache License 2.0
11 stars 5 forks source link

Replace root timestamp with root event date + confirmation code #130

Open thobson88 opened 1 year ago

thobson88 commented 1 year ago

Currently dDID verification is done in the verify() method, which takes a DID (string) and a timestamp. To succeed, the timestamp must match that found in the header of the Bitcoin block containing the transaction that embedded the root ION DID.

Now we want to replace the passing of an arbitrary timestamp with a configured root event date, plus a short confirmation code, which together uniquely determine the root DID (and hence its Unix timestamp).

A similar change has already been implemented on trustchain-mobile: https://github.com/alan-turing-institute/trustchain-mobile/issues/26.

thobson88 commented 1 year ago

The original Verifier API looks like this:

    async fn verify(
        &self,
        did: &str,
        root_timestamp: Timestamp,
    ) -> Result<DIDChain, VerifierError>;

This API will change, because the recognised root DIDs will be known in advance, as they are uniquely determined by the configuration parameters entered by the user. Therefore the root timestamps are also known in advance and should not be passed as an argument to the verify method.

But we want to design the new API in such a way as to support: