Ontropy SDK Launches
August 23, 2023, marks the rollout of Ontropy SDK version 0.2 to selected beta partners! This update extends the feature set to include free gas, instant P2P finality, and a seamless UX to all games. It also refines the architectural components from the initial version, aiming to provide a more developer-centric interface. This article will be highly technical and is intended for developers and those interested in Virtual Rollups from a granular POV. If you are new to Ontropy or Virtual Rollups, the attached links provide a non-technical overview.
1. The Ontropy SDK is released to the first closed beta, which is now filled. To get in touch for new spots that have opened today, click here.
2. Ontropy is not only focused on user experience, but also developer experience with the launch of our Developer Portal and integration possible in under an hour with now all P2P network complexities abstracted away.
3. Ontropy Virtual Rollup users are the network nodes, validating their own data right in the browser.
- This permissionless system increases decentralization via higher participation, lowers latency with direct connections, and secures a private and scalable network.
4. Our tech team is ready to assist you in your journey to bring on new users and increase engagement, made possible through a seamless UX!
The following few sections provide in-depth descriptions of our decision making process and architectural intricacies. To get to the meat and potatoes, skip to The Cool Part.
Future Platforms: Unity, iOS, Android, and Go
Ontropy's roadmap includes expanding the SDK's compatibility to Unity, iOS, and Android. This planned expansion reflects the understanding of the growing need for cross-platform solutions, facilitating the integration of Virtual Rollup technology across various environments. It will open doors to new opportunities, including mobile-based decentralized applications based on the Virtual Rollup technology and immersive experiences through Unity, thereby broadening the scope and reach of Ontropy's capabilities.
API Access Types
Reactive API: This approach leverages reactive programming principles based on RxJS to allow more automated interaction with the Ontropy Virtual Rollup. The reactive pattern encourages real-time responsiveness and a more intuitive development process, detailed further in Ontropy's Quick Start guide.
Ontropy SDK 0.2 Features
Ontropy SDK Networking Capabilities
Ontropy 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. Ontropy 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 dependence on centralized servers.
What is 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:
- 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.
- 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.
- 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.
- 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 censorship resistance and outages.
In the context of Ontropy 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. Ontropy extensively uses the PubSub pattern to form Ontropy 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 Ontropy 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 Ontropy'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.
Source: Ontropy, Class Diagram
The Cool Part
The networking magic in Ontropy? 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. Ontropy'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 Ontropy's approach? Well, it places the actual Ontropy Virtual Rollup users as the network nodes and does so right in the browser. This is not only innovative, but exciting! Eschewing the traditional dependence on back-end servers, Ontropy'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 and is genuinely useful:
- Latency issues become virtually non-existent with direct P2P connections that cannot go down.
- Decentralization is increased as only an internet connection and device capable of loading a browser are needed to become a node.
- Even more, this is done automatically so every user who is playing and enjoying their game is also securing their own data, and the network
- Because connections are direct, data remains private and secure
- Ontropy is also scalable and adaptable as the dynamic capabilities of the Virtual Rollups SDK allow it to conform to any game with unlimited compute across an infinite horizontal spectrum (as opposed to L2s which stack on top of one another, deferring security downwards).
Ontropy SDK Cryptography Improvements
Version 0.1 served as the foundational layer for Ontropy's cryptography functions:
- Multi-party randomness generation implemented on ElGamal in ModP groups;
- ECDSA primitives;
- Other cryptographic utilities.
The cryptography was initially developed in RUST and deployed as a wasm module, encompassing only a part of the needed cryptographic functionalities.
Version 0.2 goes beyond, significantly improving the cryptography module and introducing Networking and the API for direct interaction with the Virtual rollup. This step reflects Ontropy's commitment to streamlined development, improved scalability, and enhanced developer experience in the decentralized application landscape.
Some of the cryptographic updates include:
- Modified Verifiably Fair Randomness on Elliptic Curve secp256k1: By adopting the secp256k1 curve, commonly used in Ethereum's ecosystem, Ontropy has optimized on-chain data verification. This curve's compatibility with prevalent blockchain standards enhances interoperability and resource efficiency within Ethereum.
- MuSig2/FROST for Virtual Rollup State Verification: Utilizing MuSig2 and FROST within Ontropy’s framework provides a secure and efficient means to verify the virtual rollup state, aligning with Ethereum's multi-signature requirements and consensus mechanisms.
- BLS12_381 Base Curves for Optimized BLS Verification (Experimental): The experimental incorporation of BLS12_381 base curves sets the groundwork for advanced BLS signature verification, a feature aligned with Ethereum 2.0's ambitions for scalability and efficiency.
These cryptographic updates reflect Ontropy's strategic alignment with Ethereum, enhancing functionality and performance within the Web3 environment.
SDK Documentation and Support
With the launch of version 0.2, Ontropy is not only releasing an updated SDK but also introducing a comprehensive technical documentation portal. This initiative represents a commitment to support and grow the developer community around Ontropy's Virtual Rollup technology.
Technical Documentation Portal The newly-established portal serves as a central hub for all technical resources related to Ontropy SDK. Check it out: https://developers.ontropy.io
Here's what it currently includes and what it's aimed to become:
User Guides and SDK Documentation: The portal offers detailed user guides and extensive SDK documentation, catering to developers at different expertise levels.
Getting Started Guides: For those new to Ontropy, these guides provide step-by-step instructions on initial setup, configuration, and basic functionalities. SDK Reference: A comprehensive documentation covering all classes, methods, interfaces, and modules within the SDK. This section serves as a go-to manual for understanding the SDK's architecture and how to utilize its features. Sample Code and Tutorials: Practical examples and tutorials offer hands-on experience in building applications with the SDK, promoting learning through practice.
Future Evolution into a Technical Community: Ontropy's vision for this portal extends beyond being a mere repository of guides and references. It is planned to evolve into an active technical community, where developers can:
Manage Virtual Rollup Settings: Customization and control of rollup parameters will be accessible, providing developers the autonomy to tailor the Virtual Rollup to their specific requirements.
Manage Access Keys: A centralized interface for handling authentication and authorization, ensuring secure access and management within the Ontropy ecosystem.
Access Real-time Monitoring Data: Developers will be able to track critical system stats, key performance indicators, and related data on-the-fly. This feature enhances the ease of performance tuning, issue diagnosing, and strategic decision-making.
By building this platform, Ontropy aims to create a collaborative and resource-rich environment. The integration of community input, support forums, and regular updates will foster innovation and growth within the ecosystem. The technical documentation portal reflects Ontropy's dedication to nurturing a developer-centric culture, recognizing that a well-supported community is instrumental in driving the adoption and success of Ontropy's Virtual Rollup technology.
Ontropy's cryptographic functionality is fundamentally built on WebAssembly (Wasm), and it is packed with modern tooling based on Vite to ensure comprehensive browser support. Here's an in-depth look into why Wasm plays a crucial role in Ontropy's compatibility and its benefits:
WebAssembly (Wasm) in Ontropy WebAssembly is a binary instruction format that operates as a virtual machine to execute code at native speed. The application of Wasm in Ontropy's cryptographic components offers several key advantages:
Performance: Wasm's binary format ensures that the code executes faster compared to the traditional approach. This leads to improved computational efficiency, particularly significant in cryptographic operations that demand high performance.
Language Flexibility: Wasm enables Ontropy to write cryptographic functions in languages like Rust, which are then compiled into Wasm. This promotes code optimization and allows leveraging language-specific features for enhanced security and reliability. It also allows us to build native libraries for any platform if needed.
Platform Independence: Being a standard supported by modern browsers, Wasm ensures that Ontropy's cryptographic features are consistent across various platforms. This platform-agnostic nature reduces fragmentation and facilitates smooth integration.
Security: Wasm operates within a sandboxed execution environment, minimizing potential security risks. Its strong typing and structured control flow provide additional layers of safety.
Integration with Vite: Packing with Vite, a build tool that aims to provide a faster and leaner development experience, enhances Ontropy's loading speed and compatibility across browsers.
Browser Support Ontropy's reliance on Wasm aligns it with all modern browsers that support WebAssembly. This corresponds to an estimated 95.07% share of global users, with an additional 1-1.5% that could potentially be converted to support with certain adjustments.
It is worth noting that addressing compatibility with older browsers that lack Wasm support is not a current priority for Ontropy. The rationale behind this decision stems from:
Aligning with up-to-date standards and technologies that are progressively adopted in the development community. Concentrating efforts on enhancing features and functionality for the majority of users rather than diverting resources to cater to a diminishing segment. Ontropy's compatibility strategy, grounded in the utilization of WebAssembly, supports its commitment to delivering a robust, efficient, and secure solution. By focusing on modern browsers and leveraging Wasm's benefits, Ontropy ensures that its cryptographic functionality is accessible and optimized for the vast majority of users. This approach reflects a balance between technological innovation and practical considerations, aligning with Ontropy's vision and the evolving landscape of Web3 applications. You can check the browser compatibility on https://caniuse.com/?search=wasm
Thank you for reading about the Ontropy SDK Launch. Our closed beta is currently full, but we are excited to open new spots starting today. To get in touch, please leave your function requirements and other needs and use cases in our short application form here.
We release new and exciting articles here and to your email every Wednesday. You may consider subscribing via the button down below. Additionally, following Ontropy’s Twitter (X) serves as a good source of community and tech quicktakes.