The Hydrogen Network
We are thrilled to announce the release of the Hydrogen Network. A fully featured decentralized network that supports running the Stable Diffusion image generation tasks.
From the application's perspective, it is an inference API service on the cloud that could be used just like AWS. The application submits the task to the API, and gets the images in return.
The computation power comes from a decentralized network of the home computers that are coordinated by a consensus protocol running on the Blockchain. The individuals who have the spared computation power could connect their devices to the network, exchanging the computation power for tokens by starting a node, to run the inference tasks for the applications.
The Hydrogen Network is the very first testnet of Crynux. Although called a testnet, the featured consensus protocol is robust enough to allow everyone to join at this moment.
In case you can't wait, here is the getting started guide for the application developers: https://docs.crynux.ai/application-development/application-workflow. And this is the getting started guide for the node providers: https://docs.crynux.ai/node-hosting/join-the-network
The Image Generator
Let's start by introducing the Image Generator, the first application running on the Hydrogen Network.
The Image Generator provides a web interface (just like stable-diffusion-webui
) for the users to generate images in the browser. Thanks to the Hydrogen Network, the application could be used on the devices that do not have a capable GPU integrated. If the browser exists, the Image Generator could be used.
The base models, such as SD1.5 and SDXL, can be selected in the user interface. The LoRA models can also be selected and combined with the base model. The OpenPose Controlnet is also supported. The users could even input a model download link from Civitai to be used as the LoRA model.
So far, the application looks exactly the same as a traditional web application, nothing special. Until the "Generate Image" button is clicked, and the modal displaying the task execution status is shown, we could find a little bit of difference.
From the modal, we could see that the task is sent to the Blockchain first, and then executed on the computation nodes, and finally the result images are verified and retrieved.
The Image Generator can be accessed directly online, give it a try yourself:
The Decentralized Computing Network Underneath
The Blockchain has maintained a list of all the available nodes in the network. When a task is sent to the Blockchain, the Blockchain randomly selects 3 nodes in the list, and notify them to execute the task.
The nodes will run the task locally. When the images are finally computed, each of the nodes will disclose a similarity score on the Blockchain. The Blockchain compares the score of 3 nodes to find out if there are nodes who are escaping from the computation by submitting random scores, to save the local resources. If the result is validated to be correct, the images are returned to the application. And the nodes will get paid. The video below demonstrates this process:
Four windows are shown in the video:
- Top-left: the Image Generator application
- Top-right: the WebUI of the Crynux Node
- Bottom-left: the Blockchain explorer
- Bottom-right: the logs from the Docker container of the Crynux Node
The image generation started from the user's operation in the Image Generator(top-left window). The user selected a base model and a LoRA model, and then clicked the "Generate Image" button. A modal popup was displayed to show the running status to the user.
The task was sent to the Blockchain. When it was confirmed on the Blockchain, the event logs were shown in the block explorer(bottom-left window). When the task started executing, the task execution status changed from "idle" to "executing" on the WebUI of the Crynux Node (top-right window).
More logs of the Node was printed(bottom-right window) and more event logs appeared in the block explorer when the Crynux Nodes finished the local execution and started to execute the consensus protocol on the Blockchain.
Then the task was successfully finished, the images were shown in the Image Generator, and the status of the Crynux Node became idle again, with 10 more tokens in the wallet.
As a decentralized task execution engine, the Hydrogen Network lays a solid foundation for the Crynux Network. Upon which more task types will be supported, such as the fine-tuning of the Stable Diffusion models, and GPT models, in a short future. And the decentralized model serving layer will be built next.
The most important thing in the decentralized network is the consensus protocol, which ensures that all the nodes are behaving honestly. Since beside the rules defined in the consensus protocol, there is nothing else to control what a node can do. They join and quit the network freely. Nobody knows who they are and where they are. They will try to exploit all the vulnerabilities in the consensus protocol to get more tokens at lower cost.
Find more about the consensus protocol in the document:
https://docs.crynux.ai/system-design/consensus-protocol
Start a Node
If you have purchased an NVIDIA RTX graphic card, whether for gaming or designing, why not letting it make some extra profit for you, when you're not using it.
The node can be easily started on both Windows and Linux machines. The node is limited to a Docker container, which can not affect the other parts of the system. An integrated WebUI is provided to visualize the node status and the system resource usage, which also provides an easy way to control the node:
The node can also be started in the headless mode, which is convenient for the server environment. After proper configuration, the node will automatically join the network when the container is started, and quit the network when the container is terminated.
Open Source and Well Documented
Crynux is committed to build an open and democratic ecosystem. We prioritize the community by being completely open to it. The projects are open sourced from day one. A lot of efforts have been put on the documentation of every aspect of the system.
All the source codes of the Hydrogen Network can be found on the GitHub:
All the technical documents of the Hydrogen Network can be found on the documentation site:
If you want to learn more about the design of the Hydrogen Network, start from the network architecture:
https://docs.crynux.ai/system-design/network-architecture
And don't hesitate to contribute, you are always welcome to join the revolution.