Architecture and basic conditions for organizing video hosting based on a p2p-network

The paper discusses the principles of developing a software package based on a distributed registry (proprietary blockchain) for performing applied tasks within a decentralized video portal. Such structure is concerned to distribute of usergenerated content, implying the principles of "reverse economy" that suggest to reward proactive users of the service via sharing advertising revenue of the video portal amongst all participants in the advertising chain.


Introduction
The paper proposes the principle of an architectural solution for a software package based on a proprietary blockchain registry, designed to encourage user activity. This approach allows to implement one of the applied functions of the blockchain -monitoring the chronology of the consensus execution.
Unlike popular blockchain platforms, the proprietary system operates on the server side, rather than the client, what eliminates the burden on the computing power of users.
The innovativeness of the proposed approach is presented in the consensus of the distributed registry system, which allows to distribute advertising revenues in real monetary units amongst all participants in the content distribution chain (advertising aggregator, web portal, author, audience). The creation of a video portal in this project is a secondary mandatory task that is concerned to demonstrate the system's performance.
The basis for the software architecture is complex, according to the fundamental conditions of the distributed ledger system that is functioning as proprietary cryptographic system. Hereinafter, we will refer to it as "blockchain". Such title is referring to its architectural features, established through peer-to-peer network (P2P network) and based on the principle of distributing tasks and responsibilities between its nodes. The nodes of such a network are equal [1][2][3].
There is no hierarchy in a peer-to-peer network, as well as all its nodes are interconnected simultaneously providing and consuming data on equal terms. Such point makes the P2P network potentially resilient to individual node failures, since there is no single point of failure in such architectural construct. Importantly, all nodes in a peer-to-peer network are equal in rights, but their certain roles may differ. In particular, in the Bitcoin peer-to-peer network, clients vary greatly in functionality -from "full nodes" that store the entire history of the blockchain and give any block on request, to "light nodes" that store only headers and the last few blocks. This principle of distribution of roles was taken as a basis in this decision.
The main nodes of the system are: service users; promotional videos; comments in discussions; blocks with stored results of quantitative and qualitative analysis of user activity; interests of users (change over time); advertisement income from commercial views that is distributed amongst all stakeholders of the service (Figure 1). The implementation of such architecture is shown in the startup VideoStake, which is now being developed on the basis of DSTU-students (headed by I.S. Kalashnikov). The interaction scheme of the nodes is shown in Figure 2.

Backend components
The peculiarities of the organization of the peer-to-peer structure are closely related to the problem of finding information in it [4][5][6]. The search begins with the fact that the node, concerned to find a file, is regarded to generate a request containing the signs of this file. The task of the search algorithm is to ensure that this request is delivered in the most efficient way to the node(s) that actually has/have the desired file. The main stages of the search process, regardless of the specific algorithm, are: 1) formation of a search query; 2) sending a search query; 3) local execution of the request; 4) sending the search result; 5) processing of search results; Different search algorithms differ mainly in the mechanism of forwarding and delivering the search query to the node with the desired information. Based on how the nodes of the structure are interconnected to each other and how information is searched in such network ( Figure 2), the approach of the structured P2P network was chosen for the implementation of the project. Structured peer-to-peer systems use routing algorithms to find nodes. The routing algorithm determines exactly where the target node should be located in the overlay structure. This process is closely related to the geometry of the P2P network and the connectivity or information stored at each node (Fig.3).
In this case, the most convenient is the DHT (Distributed Hash Table) -based routing algorithm, which uses the hash of the node identifier to form a uniformly distributed identifier space [7,8].
The file identifier is generated using the same hash function. Hence, node IDs and data IDs fall into the same ID space. Files are usually stored at the closest node with a node ID greater than or equal to the file ID. This approach allows any node to find a specific file by its name. If the file you are looking for is not found on the node with the closest identifier, then such a file does not exist on the network (Fig.4). In our case, the SHA256 algorithm is used. An example of a class that implements this stage is shown in Figure 5.

Frontend components
For the web portal and related user functions of the VideoStake service, a web interface was developed that meets all modern requirements and principles of video hosting. Figure 6 shows a screenshot of the user authorization panel.
After logging into his account, the user can watch the videos of interest to him (Figure 7). After that, information about the funds collected through views is accumulated in his personal account.
In the user's personal account, it is possible to track the dynamics of the accumulation of funds collected by users, who is watching advertising videos ( Figure 8).

Practical implementation
Taking into account a dynamic nature of digital technologies, it is important for practitioners and academics to understand why users intend to continue to be its users or not [9][10][11]. The study of the performance of the software complex was carried out as part of a group experiment of user experience. Table 1 shows the result of a comparative calculation of income per 1 video channel with 4 pieces of video content uploaded per month. The comparison represents high effectivity of native advertisement towards classical ads that interrupt user experience of video watching. A possible operator for native ads might be "Mirriad", a UK company that is concerned to add advertising by real-time editing video canvas via CV [12]. Virtual loans are used as real currency.