Skip to content

Instantly share code, notes, and snippets.

@jejuro
Last active March 7, 2018 05:30
Show Gist options
  • Save jejuro/c8832b36db13bf53ff3b7e6098f87875 to your computer and use it in GitHub Desktop.
Save jejuro/c8832b36db13bf53ff3b7e6098f87875 to your computer and use it in GitHub Desktop.

Part V - National Archive Infrastructure

Again, the key merit of OP is that it can be applied to all kinds of social/industrial infrastructure without any significant modification. You can see it in the case of document management too.

Table of Contents

  1. How to manage documents
  2. How to generate documents

The purpose of NAI is to rebuild the the National Archive Institute of Korea as an application of the Openhash Platform. There is yet another purpose. Let’s take a moment to think about the current documenting culture among white collar workers.

Document is to deliver information, to witness contracts or to approve historic events so on. Nothing more or less. However, some people regard all papers including documents as canvas to show their aesthetic senses. So, they like decorate documents with various fonts, lines, angles and colors so on. They call it forms or formats.

What a nonsense. Why people take it granted for those abnormally aesthetic people to use documents as drawing canvas to express their aesthetic sensibility. This custom is as weird as the custom of an african tribe lengthening their necks using rings or widening their bottom lips using wooden dishes.

Here is suggested a sound idea of how to create, share and store documents. It might seem too progressive, but it’s because we are quite accustomed to lengthened necks around us. Let’s see what is normal, what is sound and what is efficient.

Each of the two different topics are described below respectively. -How to generate documents.

  • How to distribute, read, and manage documents.

Because the blockchain is a record system that can not be tampered with, the National Archive Institute, which keeps government produced documents, is the best place to apply the blockchain technology.

Some advantages of the Openhash-based National Standard Documentation System include:

  • All records are kept permanently.
  • The responsibility and performance of each employee is clear.
  • There is no need for a regulatory agency such as the current National Archives.
  • Time to create/distribute/maintain/preserve documents can be significantly reduced.

National Archive Infrastructure(hereinafter, NAI) has three targets to record, and a different mechanism are applied to each of them.

  • Document content
  • History of sending and receiving documents
  • History of reading documents

1. How to manage documents

The history of sending and receiving documents is recorded in Document Transaction. Content of the document is subject to Content Hashing.

1.1 Document Transaction(DocTx)

NAI records the history of sending and receiving documents. Documents are only delivered by request of a reader or consumer. Thus, the Document Transaction module keeps track of who has requested which document and who provided it.

Since sending or receiving a document is interweaved by hashes, the forgery and falsification of history is immediately detected same to the case of standard currency.

The Hashing mechanism of previous blockchains is shown in the figure below.

The Hashing mechanism of DocTx is shown below.

  • Like that of standard currency, the document content of a DocTx is not delivered directly but via the pointer of it with the hash of the content.

1.2 Content Hash

A hash is derived from document content including metadata such as a document creator, and is included in Doc Tx. Therefore, submitted document can not be forged or modified later.

1.3 View History

Different for transactions of standard currency, the ownership of a document is not changed. So, the history of who viewed which document and when and where it has been viewed is recorded separately.

  • If the address server of viewer is same to that of the document owner, the view history of the document is recorded in the same Supul server.
  • If not, the history is recorded in the upper tier Supul server.

Let’s assume the lower tier Supul servers A, B and C independently records the history of view events, forming each block. That is, each server manages each block of view history. -B: If all the view events are done by viewers whose address server is same to the document server. -A, C: if different(orange and green), the view events are recorded by their upper Supul server.

Note that the question of which upper-tier server records which view event is determined by the common upper server mechanism described in Part II Standard Cryptocurrency. If a resident of New York views a document stored in a server of Washington, the view event may be recorded by the Supul server of US. But, he/she views a document of Seoul, the event shall be recorded by the Onnuri server.

So, the view history of documents stored in lowest Supul servers are interwoven by their upper servers, and the kinds of upper servers encompass all servers in the server hierarchy of Openhash Platform.

Yes, 직녀 Jignio works here too.

The data of who created what documents and who has viewed which document when and where can’t be counterfeited at all, not to mention of those documents kept forever as digital data. So, we can perfectly substitute the current Korean Archive Institute with NAI.

2. How to generate documents

The following discussion assumes that the XMPP-based Space Web is already configured. For technical details, please refer to the Space Web section of Openhash Platform.

2.1 Distributed Systems

Unlike the existing National Archives, the Openhash-based NAI is a distributed system. Every document is an electronic document, and all documents are interwoven with Hashes. Image: Wikipedia

Each document is given a unique IPv6 address, representing the agency that produced the document via the Subnet ID of the IPv6 address. For example, the unique ID of the health insurance corporation or the water resource corporation may be 1234. Some of the 65,536 numbers(16-bits in the Subnet ID field) can be assigned to governmental or public organizations. The unique ID of each document can be represented by the lower 48 bits of the interface area.

2.2 Player ID

Assuming a Korean population of 50 million, each person has a unique space web ID. The ID of each citizen is same to the player ID (= Space Web ID) of the Open Hash platform.

2.3 Document Types

The document editor of OP is server-based, such as Google Docs, and is installed on the XMPP server that makes up the Space Web. The documents of OP are classified into two groups depending on how they are generated.

  • Auto-generated DB-based documents
  • Standard documents

2.3.1 DB-based documents

It includes documents automatically generated by the DB system, such as certificates and registration cards.

2.3.2 Standard Documents

Every document is an instance of a standard document.

As of 2018, there are more than 3,000 document forms used by Korean governments. The standard document is a concept similar to the conventional document forms. Editor is similar to an electronic wallet of the standard currency.

The difference between the conventional document forms and the standard document is that:

  • Only one standard document corresponding to one form name.
  • Intelligent. The author's department, department, address, name, and contact so on are automatically filled in.
  • All documents share one common DB. For example, if a natural person A enters his/her name and date of birth when he/she enters elementary school, he/she does not need to write his or her name and date of birth in any document throughout his or her life.

We can assign a few numbers of Subnet ID(=Subnet Prefix) to a standard document. If we assign the first 16-bits field of the interface ID to document forms, we can have 65,536 kinds of forms. Therefore, all the organizations that make up the government can share the pool of standard document forms.

A standard document is a key-value format. Similar to MongoDB-based Google Firestore. Image: Google

The remaining 48 bits of the interface area can represent the unique ID of an individual document.

Standard documents are also intelligent. Intelligence is expressed in the following two forms.

  • Smart Contracts: You can specify the validity, scope and conditions of documents.
  • History Hashing: recorded is who has read, modified, updated or deleted any document at any time, and the record is protected by interwoven hashes.

2.3.3 Permanence of Records

Due to the nature of the blockchain, already submitted documents can not be modified, updated, or deleted in the future.

2.3.4 Document retrieval

Search of standard documents and document instances is by Bloom filter. Thus, the user can quickly search for and use document forms that are suitable for his / her use. Image: Wikipedia

2.4 Editor

Text editor of NAI is more like e-mail than traditional word processor such as Hangul and MS Word.

  • Authors, co-authors, recipients and referrers are automatically recorded.
  • Web based and limited functions.

On the other hand, the difference from e-mail is as follows.

  • Based on XMPP, not HTTP.
  • The signature of the author and the recipient are private keys in the blockchain.
  • Contains the latest document hash of the author and the recipient (refer to Openhash's Hash Algorithm).

This tool integrates text editor and table calculation application into one. The hash is extracted from the created document data and assigned to the value of the specific key.

  • Because it is browser based (Plugin, Extension), there is no need to install on PC.
  • Very light.
  • Use JavaScript and Erlang language.
  • Use the Cycle.js framework.

2.4.1 Standard Word Module

A text editing tool based on Firepad, written in JS and can easily be added to source code of web applications.

2.4.2 Standard Sheets Module

A spreadsheets tool based on JSpreadsheets.

To be continued...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment