P2P Capabilities

Our SDK is capable of true P2P transactions without sacrificing security or the user experience

Virtual SDK Network Capabilities

Virtual supports two main communication methods:

  • Peer-to-Peer Networking using WebRTC Direct: A decentralized communication structure that aligns with the principles of Web3.

  • Broadcast Networking on socket.io: In version 0.2, this is the default option. Virtual plans a gradual transition to peer-to-peer (P2P) as the supporting infrastructure expands. The P2P approach underscores the core tenets of decentralization, enhancing resilience, reducing latency, and negating centralized servers' dependency.

Whats interesting about it? WebRTC Direct is a decentralized communication structure tailored for peer-to-peer (P2P) connections, highly suitable for the principles of Web3. WebRTC enables direct communication between browsers without the need for an intermediary server. This is achieved through a process called signaling, which involves the following technical steps:

  1. ICE Candidate Gathering: ICE (Interactive Connectivity Establishment) protocol is used to gather possible ways (candidates) to connect with peers. These candidates include potential IP addresses and ports of each peer.

  2. Offer/Answer Model: One peer (the offerer) creates an offer that contains information about media and supported codecs. The other peer (the answerer) then responds with an answer.

  3. NAT Traversal using STUN/TURN: In cases where peers are behind Network Address Translation (NAT) or firewalls, STUN (Session Traversal Utilities for NAT) servers are used to discover public IPs and ports. If a direct connection fails, TURN (Traversal Using Relays around NAT) servers act as relays to aid the connection.

  4. DTLS Handshake: A secure channel is created using the DTLS (Datagram Transport Layer Security) handshake, ensuring encrypted communication.

Decentralization Aspect of WebRTC Direct The pivotal feature that distinguishes WebRTC Direct is its inherent decentralization. Unlike traditional client-server models where communication passes through a centralized server, WebRTC establishes a direct pathway between peers. This offers several key advantages:

  • Data Privacy and Integrity: Direct connections eliminate potential interception points, enhancing data privacy.

  • Reduced Latency: As data doesn't have to travel through a central server, communication is more immediate, optimizing real-time interaction.

  • Enhanced Resilience: Without dependency on central servers, the system is less prone to single points of failure.

In the context of Virtual and Web3, WebRTC's decentralized nature is synergistic with the underlying ethos of transparency, trust, and elimination of centralized control. It empowers users with true ownership of their connections, reinforcing the principles of a decentralized network, while ensuring efficiency and security in communication.

Utilization of PubSub Mechanism The Publish-Subscribe (PubSub) methodology, a well-known messaging pattern, is instrumental in the development of decentralized applications. Within the distributed networking architecture, nodes "publish" messages to a specified topic, and other nodes that have "subscribed" to that topic receive those messages. In the absence of reliance on central brokers, PubSub is aligned with the principles of a trustless and decentralized ecosystem. By employing this method, information dissemination becomes highly flexible and scalable, fostering real-time communication and collaboration without exposing the inner intricacies of the network. Virtual extensively uses the PubSub pattern to form Virtual Rollup sessions.

Integration of KatDHT and Kademlia for Distributed Hash Table (DHT) At the core of decentralization, implementing Kademlia-based Distributed Hash Tables (DHT) like KatDHT enhances the capability of Virtual Rollups. This algorithm establishes an unstructured network topology, where nodes maintain data regarding other participants. By crafting a logical domain where each node holds a subset of the whole data, information can be retrieved through a series of inquiries. This design minimizes the reliance on specific nodes while maximizing fault tolerance and ensuring rapid response time. A fusion of Kademlia with Virtual's architectural features yields a network that's both robust and adaptable to the fluidity of a decentralized landscape, sculpting an advanced framework for interconnected communication.

The Cool Part

The networking magic in Virtual? It's all under the hood. Whether it's WebRTC or any other decentralized communication wizardry, developers don't have to sweat the small stuff. Virtual's got it covered. The entire peer-to-peer networking layer is seamlessly abstracted away, leaving developers free to focus on what matters most: crafting top-notch decentralized apps. It's like having a supercharged engine that takes care of itself, letting developers ride the Web3 wave with style and ease.

Now, what's unique about Virtual's approach? Well, it places the actual Virtual Rollup users as the network nodes and does so right in the browser. That's not just innovative; it's downright exciting! Eschewing the traditional dependence on back-end servers, Virtual's in-browser execution hands over the keys to genuine decentralization. No intermediaries, no needless complexity – pure, unadulterated P2P interaction.

This novel concept goes beyond a mere technological flair. It's transformational. Think about a surge in speed, with latency issues becoming virtually non-existent. Privacy and security? Taken to unprecedented levels. Scalability and adaptability? Unleashed like never before, free from the constraints of conventional methods. Virtual's approach serves as a catalyst, empowering Web3 developers and users with a high-powered engine for decentralized applications. This isn't just a fashionable trend; it's a substantial advancement in the way we create and engage on the web, marking a stride toward the future of interconnected digital landscapes.

Last updated