# VidBlock: A Web3.0-Enabled Decentralized Blockchain Architecture for Live Video Streaming
## 3 System Design
### VidBlock Data Model
#### 3.2.1 Data Structure and Registries in VidBlock  
In the VidBlock system, the data structure and registry components serve as foundational elements that support decentralized streaming, data integrity, and user autonomy. As shown in Figure 2, these elements are organized to enable efficient content management, secure user interactions, and reliable P2P streaming connections. * **Smart contract layer:** The smart contracts in VidBlock serve as an automated governance layer, managing essential operations related to live streaming activities. This layer includes several key registries that ensure efficient coordination and management within the network. * **Node registry:** At the core of VidBlock's architecture is the node registry, a smart contract responsible for maintaining ViB IDs, credentials, and content lists for nodes. This registry plays a critical role in node authentication and content management, generating a new contract for each user upon registration. Nodes, identified as either producers or consumers, are assigned unique ViB IDs, which can be customized for easy recognition. By decentralizing node management, the Node Registry addresses challenges associated with centralized data storage, enhancing data integrity and accessibility across the network. It provides a transparent, secure system for managing data ownership and access rights, ensuring traceability for all content. * **Node registry addresses:** This registry holds the contract addresses for each node registry, allowing interaction with the system through predefined contracts. It maintains a list of content hashes mapped to their corresponding nodes via ViB IDs, which supports efficient content retrieval and verification within the network. * **Relay registry:** The relay registry plays an integral role in managing relay nodes within the blockchain network. Relay nodes are specialized nodes that facilitate initial P2P streaming connections between client nodes. The registry records the public IP addresses of relay nodes, aiding in the selection of the appropriate IP information for P2P connections between clients. This is particularly useful when ViB creator and consumer nodes are on dynamic IPs, different networks, or the same network, ensuring stable and reliable connections. * **Distributed and personal storage systems:** In the VidBlock network, data storage is managed through a combination of distributed and personal storage systems, each fulfilling specific roles to support decentralized streaming, user privacy, and efficient data management. This multi-layered approach reduces reliance on centralized servers, enhances content availability, and enables user-controlled data management, all while upholding the integrity and accessibility of the network. Below is a breakdown of each storage component within this framework. Distributed storage system: VidBlock utilizes a distributed storage solution to manage content metadata and completed content across its platform. When a ViB creator node initiates a live stream, the system stores key metadata, such as an image, title, and ViB creator ID, in the distributed storage. The hash value of the content is sent to a relay node and also recorded on the blockchain, providing a secure and immutable record to ensure data integrity and accessibility. Additionally, any content that has been completed or uploaded by ViB creator nodes can be stored in this distributed storage system. This approach reduces dependence on centralized servers, allowing content to be widely available across the network and accessible to authorized nodes as needed. * **Client node personal storage:** Each client node in the VidBlock network has its own personal storage area, which is used to cache and manage the streaming content that it consumes. Client nodes access streaming content metadata from the distributed storage system, using hash values provided by the live streaming registry to retrieve relevant data.