• Nenhum resultado encontrado

Universidade do Estado do Rio de Janeiro

N/A
N/A
Protected

Academic year: 2023

Share "Universidade do Estado do Rio de Janeiro"

Copied!
123
0
0

Texto

In this work, we propose a permissionless peer-to-peer (P2P) system to manipulate decentralized JSON datasets, where all users participate in a consensus mechanism to maintain data consistency and correctness. As an emerging alternative, peer-to-peer (P2P) systems [7] aim to decentralize control so that applications grow organically with new users [8], contributing to storage, availability and, in our context, also with more modern users. -ation of the datasets.

Collaborative Applications

Types of Collaborative Applications

  • RTCE: Real-Time Collaborative Editing Platforms
  • VCSs: Version Control Systems [1]

In a VCS, each user can make modifications to the file in their local copy, which is essentially a separate branch of the original file. Other users can then pull the latest version of the file from VCS, which includes the changes made by the original user.

Wikipedia

Editors are banned as a result of the dispute resolution process, violating a ban may result in a ban. In summary, Wikipedia [5] was built based on the wiki system, using rich structures, and is a permissive environment, using proprietary administrators to guarantee the integrity of posted content by avoiding vandalism and SPAM.

Consistency models

Types of Consistency Models

Eventual consistency (EC) "guarantees that if no new updates are made to the shared state, all nodes will eventually have the same data" [32]. The key feature of eventual consistency is that, given a sufficiently long period of time without updates, all nodes in the system will eventually converge to the same consistent state.

Intent-Preserving Consistency

And what happens if the replication conflict cannot be resolved, in case of concurrent editions of the same item. In the case of replicas R1 and R2, a radical approach could consist of throwing away changes and returning to the original document, back to the word "Hello".

CRDTs: Conflict-Free Replicated Data Types

  • Decentralized Conflict Resolution
  • CRDTs Approaches: CvRDTs & CmRDTs
  • CmRDTs and CvRDTs: Pros and Cons
  • Automerge: a JSON CmRDT

In other words, when several operations are performed in sequence, the result is the same regardless of the order in which the operations are grouped. We can see a large reduction in the size of the file that will be stored on the replica and afterwards replicated among the other replicas.

Figure 3 - CvRDT (converged replicated data type) - State Based
Figure 3 - CvRDT (converged replicated data type) - State Based

Peer-to-Peer Systems

  • Overlay Networks
  • Unstructured vs. Structured P2P systems
  • Consensus in P2P Protocols
  • Freechains: Permissionless Reputation-Based Consensus
    • Internal Operations
    • Reputation System

Structure refers to the way network content is located in relation to the network topology" [7]. When a new node joins the network and wants to download a file, it contacts other nodes in the network and requests parts of the This allows that each peer is responsible for a specific piece of content in the network, so that queries can be efficiently directed to the node with the desired data " [47].

Some of the most common consensus mechanisms used in permissionless blockchains [63] include Proof of Work (PoW) [13], Proof of Stake (PoS) [64] and Delegated Proof of Stake (DPoS) [65] . A block with forbidden content must be maintained in the chain's graph, as the integrity of Freechains depends on the immutability of the graph. Thus, what is not retransmitted is the content of the block with the message itself.

Figure 12 - P2P Pure x P2P Hybrid
Figure 12 - P2P Pure x P2P Hybrid

Ecosystem of the Proposed Solution

Therefore, the network self-moderates through the most credible posts (update operations) and the most active users and determines which edition preserves the intent of the majority of the user community. The same reputation system also guarantees the integrity of the data from the point of view of haters, SPAM, fake news, illegal content and Sybil attacks [9], since the most active and trustworthy users can remove reputation from malicious editions that can damage the quality of the content and preventing them from being spread on the network. Since no differences were posted later, he makes this file available to AMDIFF to obtain the difference between the local replica edited by the user and the original file that was on the network.

This new difference is available for posting on a new post on the Freechains chain. Automerge's CRDT system will be responsible for maintaining consistency by merging concurrent editions, and users will be able to solve the CRDT corner case through Freechain's reputation system, which is simultaneous concurrent editions of the same item, item, word, etc. So that the edition that rules, which has the most likes, maintains the intention of the majority of the network, which guarantees the accuracy of the information.

Figure 17 - Ecosystem proposed.
Figure 17 - Ecosystem proposed.

AMRW: Automerge-JSON Command-Line Editor

This file is accessible to AMDIFF, which will obtain the difference between the local replica with the new edition created by the user, and the rebuilt file with what was on the network. All commands after the file name and before the "read" mode are part of the navigation path. An important consideration is that the create, edit, and delete operations of the local-first JSON file must be performed via explicit commands, which this tool implements, so that these update operations are actually recorded in the internal history of the Automerge saved file .

We use this file data to run the DIFFs and PATCHs and travel in the Freechains P2P network blocks. The manual with the complete syntax of AMRW commands is available in the appendix of this work. Through these examples, we demonstrate AMRW, a local-use tool, via the command line to edit a JSON file in Automerge format.

AMDIFF: Automerge-JSON Command-Line Diff

The result is encoded in binary Automerge format and saved as a local file. The file will be saved to disk with the name "old-new.diff", which consists of the names of the two compared files. This file will contain the differences between the compared files, stored in binary format.

The manual with the complete syntax of AMDIFF commands is found in the appendix of this work.

AMPATCH: Automerge-JSON Command-Line Patch

A file named new.am is saved to disk and its contents consist of the data contained in old.am with the contents of old-new.diff (the changes received via AMDIFF). The manual with the complete syntax of AMPATCH commands is in the appendix of this work.

Timeline Simulation

Changes to the file will be made through AMRW, all recorded in the results file. Recompile the original file using the first file downloaded from the chain and inserting the differences present in the second downloaded file. Recompile the original file using the first file downloaded from the chain and inserting the differences present in the second and third downloaded files.

At that moment, Freechains-JSON compiles the entire data structure by concatenating all the operations incrementally stored in the blocks of the Freechains chain. The manual with the complete syntax of Freechains-JSON commands is available in the appendix of this work. In sequence by AMDIFF obtains the difference between the file edited by user C and the file recompiled with the content posted in the chain, this difference is posted in the chain by the command Freechains post.

Figure 18 - Execution timeline.
Figure 18 - Execution timeline.

Decentralized Network Protocols

Federated Protocols

It is designed to enable federation between different instances of the protocol, allowing users to connect and communicate with each other regardless of the specific platform they are using. It allows users to communicate with each other regardless of the service or device they are using. One of the key benefits of the Matrix protocol's decentralized architecture is that it gives users greater control over their data and content.

One of the challenges with federated protocols is maintaining data consistency across different nodes or servers in the network. Each node maintains a copy of the data and periodically synchronizes with other nodes to ensure that the data is consistent and up-to-date. This approach helps distribute the workload and reduce the risk of data inconsistencies, as each node is responsible for a smaller subset of the data.

Peer-to-Peer Systems

In our work, users through the reputation system, when they identify malicious behavior, SPAM, haters or anything else that damages the integrity of the data, can block this content through the collective reluctance, maintaining the integrity and protection of the network. In our work, all nodes have a complete copy of the network, therefore we do not rely on DHTs. Consensus along with the reputation system based on proof-of-authoring maintains the accuracy of the data.

To ensure data consistency and accuracy in P2P networks, consensus can be achieved through a variety of mechanisms, depending on the architecture and specific goals of the network. Maintaining data integrity is also a key point and can be difficult to manage precisely because of the lack of centralized control. To face these challenges, in our work in a permissionless P2P environment using JSON datasets, materialized in a P2P Wikipedia, we used Automerge CRDT to achieve consensus between user publications and CRDT corner cases , such as simultaneous publications of the same article, we use the Freechains reputation system based on authorization authentication (using likes and dislikes to keep or block a certain post with update operations) to maintain the accuracy of the data, consider users' intent.

Decentralized Wikis

Therefore, we realize that in order to maintain data integrity, Everipedia is increasingly seeking a permissioned approach, through a group of content moderators who, according to the founders, “scroll through every activity on the site, and if there is something vague, we take it down" [80], via the "soft delete" feature that maintains the integrity of the blockchain. Our work, a permissionless distributed wiki, suggests that data accuracy is achieved through consistency based on CRDT techniques, where the decision between concurrent editions is automatic, except in the case of competing editions of the same item, in which case we use a user-based moderation system to maintain data accuracy. If two people produce version the network then distinguishes between the two.

DistriWiki users, so it is subject to individual preferences that do not always respect the common purpose of the network. In the same way that it has no treatment to prevent attacks, malicious users and enemies, to ensure data integrity. In our proposal for a permissionless P2P Wikipedia, we use Automerge CRDT to manage conflicting editions and use a consensus system together with Freechains user-based reputation system so that chain participants themselves handle instances of concurrent issuance of the same item while maintaining data accuracy and intent of users.

CRDT-Based Collaborative Systems and Applications

Trello uses CRDT to maintain data consistency and ensure that changes are made in a decentralized manner. It has a reporting system that allows users to report any inappropriate behavior or abuse of the platform. This means that all users work on the same version of the document all the time, and changes are automatically synchronized in real time.

Peritext: A crdt for collaborative rich text editing.Proceedings of the ACM on Human-Computer Interaction (PACMHCI), 2022. Eventuel konsistens i dag: Limitations, extensions, and beyond.Communications of the ACM, ACM New York, NY, USA, v. I: Proceedings of the 6th Workshop on Principper and Practice of Consistence for Distributed Data.

Imagem

Figure 1 - Consistency and its challenges
Figure 2 - Replication conflict
Figure 3 - CvRDT (converged replicated data type) - State Based
Figure 4 - CmRDT (commutative replicated data type) - Operations Based
+7

Referências

Documentos relacionados

Governo do Estado do Rio de Janeiro Secretaria de Estado de Ciência e Tecnologia Universidade do Estado do Rio de Janeiro Faculdade de Comunicação Social Programa de Pós-Graduação