INSPRATION: Traditional cloud platforms rely on opaque metering systems and centralized billing logic. We wanted to explore whether decentralized, verifiable access control could replace the entire “trust the provider” model. The goal was to design a compute rental platform where runtime, payment, and authorization are all cryptographically enforced, not assumed. This led to CloudChain VM, where smart contracts govern VM access with zero reliance on backend APIs.
WHAT IT DOES CloudChain VM implements a blockchain-governed VM rental pipeline: -Users select CPU/RAM/GPU presets in the frontend. -The specifications are converted to computational “units”, priced at a fixed on-chain cost. -A Solidity contract receives the payment, computes the expiry timestamp, and stores it in a persistent mapping. -The user can launch a real VM session through Apache Guacamole only if the contract confirms active access. -A synchronized frontend timer enforces the expiration by force-closing the Guacamole tab. The system effectively extends blockchain from finance into resource-bounded access control for real infrastructure.
HOW WE BUILT IT: The core logic is a Solidity contract (VMAccess.sol) that defines: -A mapping(address ⇒ uint256) storing Unix expiry timestamps -A payable method that verifies ETH amount and updates access time -View functions for verification (hasAccess, expiry) Hardhat was used for contract compilation, artifact generation, deployment, and RPC simulation. Using Hardhat’s local JSON-RPC provider, we bound the frontend to signer(0) the first deterministic dev accountwhich eliminates wallet-popup dependencies. The frontend was built in vanilla JS + Ethers.js and uses Hardhat artifacts to interact with the deployed contract. Apache Guacamole hosts the actual VM session; the frontend launches Guac in a separate tab to allow the parent tab to enforce forced termination. A lightweight timer (using localStorage for persistence) continuously validates the contract’s expiry state and closes the VM tab via window.close() when the session ends.
CHALLENGES WE RAN INTO: -Modern browser wallets (MetaMask, Rabby) no longer inject legacy providers, breaking traditional Web3 onboarding flows. -Handling cross-tab synchronization: the blockchain expiry is absolute, but Guacamole runs in a -separate tab, so a parent-tab watchdog system was required. -Ensuring Hardhat’s block timestamps and frontend Date.now() remain aligned, especially when issuing -synthetic evm_mine calls. -Integrating a remote desktop protocol (RDP/VNC proxy) like Guacamole with a blockchain-controlled session lifecycle.
ACCOMPLISHMENTS: -Fully functional integration of a Solidity contract with a real, non-blockchain service (Guacamole) for access gating. -A reliable, deterministic session-locking mechanism that cannot be bypassed by refreshing or switching tabs. -End-to-end architecture that demonstrates how blockchain can enforce infrastructure access without relying on cloud authentication systems.
WHAT WE LEARNED -Real-world use of Hardhat internals: artifacts, provider RPC calls, gas estimation, deterministic account management, and contract tracing. -How to bridge on-chain trust guarantees with off-chain systems, especially those not originally designed for Web3. -The significance of time consistency, block mining, user-side persistence, and cross-tab event coordination in decentralized access systems.
WHAT'S NEXT FOR CloudChain VM -Moving from Hardhat local to actual testnets (Sepolia/Arbitrum) with msg.sender-based authentication instead of fixed signers. -Switching to ERC-20 payment models with dynamic pricing (e.g., $/minute billed via Chainlink). -Containerizing VM instances and auto-provisioning them on-demand rather than using a static Guacamole setup. -Adding cryptographic session tokens tied directly to smart contract events.
Built With
- and-json-rpc-node-typescript-/-node.js-?-used-for-hardhat-scripts-and-deployment-automation-ethers.js-?-frontend-blockchain-interaction-(signers
- apache-guacamole
- blockchain
- compiler
- contract-calls
- css3
- deployment-engine
- docker
- ethereum
- ethersjs
- hardhat
- html5
- javascript
- json-rpc
- node.js
- solidity
- typescript
- web3
Log in or sign up for Devpost to join the conversation.