File storage (Docs)

Introduction

This article describes the concept of storing Docs (files of any format storing static data) on the Trusted Twin platform. 

The purpose of this article is to provide system architects and developers with conceptual knowledge required to design solutions on the Trusted Twin platform. In order to consult developer resources, please navigate to the Trusted Twin docs website.

5 min read

Figure 1. File storage (Docs) on the Trusted Twin platform. 

Concept

Overview

On the Trusted Twin platform, Docs are files of any size and format (e.g., PDF, DOC) meant to store large amounts of static data. They are attached to Twins. It is possible to attach the same Doc to multiple Twins. 

Docs, once uploaded to the platform, remain unchanged. Ledgers, in contrast, are designed for storing the state of a Twin. Therefore, they can be dynamically changed.
Read more: Ledger structure

Doc URLs

Working with Docs is based on upload and download URLs. A user generates an upload or download URLs when they need to upload a Doc, download a Doc or share a Doc with other users. 

Upload URL

Upload URLs are temporary. They are used for uploading a Doc to the Trusted Twin platform. 

The Doc upload process consists of the following steps:

1. A Doc is uploaded to a document cache associated with a given upload URL. 

2. The cached Doc is copied and attached to a given Twin.

Files stored in the cache location are removed automatically.

Figure 2. Doc upload process. 

Upload URL creation requires standard authentication and authorization. Uploading of a Doc does not require additional authentication because it is based only on the upload URL.

Download URL

Download URLs are temporary. They are used for downloading a given Doc stored on the platform. They are time-constrained. 

Download URL creation requires standard authentication and authorization. Downloading the Doc associated with the URL does not require additional authentication because it is based only on the download URL.

 

Figure 3. Doc with a download URL.

Notarization

Docs uploaded on the Trusted Twin platform can be notarized to allow for future verification of their consistency, immutability, and irrefutability. 

Basic notarization

Basic notarization is based on Doc hash calculation. A user provides a hash during the upload of a Doc. After that, the expected hash is compared to the hash calculated based on the Doc’s content. The Doc can be attached to the Twin only if the hashes match. The hash is stored as Doc’s metadata and can be verified at any time.

Advanced notarization

Advanced notarization is based on a mechanism similar to basic notarization. In addition, the hash is protected by blockchain technology. Additional data related to the blockchain transaction is stored on the Trusted Twin platform as Doc’s metadata.

Tips & tricks

  • Users can use temporary download URLs (i.e., URLs with time-to-live set) to exchange Docs on the Trusted Twin platform.

For more information about how to use the Trusted Twin platform in your application’s architecture or technology stack, please contact hello@trustedtwin.com or schedule a video consultation with us through Calendly.

ON THIS PAGE