Lease and/or rent IoT devices in a decentralized marketplace.
This project allows IoT device owners and users, through a web-based frontend, the means to lease and rent an IoT device in a decentralized manner. Using the device's ID, users would be able to retrieve information about IoT devices registered in the network, as well as rent them.
The project requires blockchain payments and creates a session for the renter to use the IoT device in relation to the amount paid.
The device owner of the rented IoT device can withdraw their balance whenever convenient directly from the dApp. The system also collects a little fee from the device owner during the time of payment from the renter.
Like the IoT device owner, the admin can withdraw fees whenever convenient directly from the dApp.
This project uses MQTT protocol to communicate to an IOT device when it is listed on the marketplace.
The IoT device owners through the IOFY UI which is created in React.js would connect their web3-enabled wallet and input the details of the IoT device they intend to list on the IOFY marketplace. These details include the name, description, image, and cost of using the device per hour.
The IOFY server first stores the metadata using OrbitDB which uses IPFS under the hood. It creates a CID from this and uses this CID along with an ID and cost amount per hour of the device, to trigger the marketplace smart contract. This is when the owner gets prompted by their web3 wallet to sign the transaction.
A user can read the details of a device on the IOFY UI by searching for that device through its unique ID.
To rent a device, the user sends some ERC20 standard stablecoin to the marketplace smart contract which is deployed on the Hyperspace network. The smart contract calculates the session period based on the amount sent and the cost per hour of the device.
Upon renting a device, an event is emitted, from which the MQTT server creates a task to unlock and lock the IoT device at the start and end timestamps respectively as determined by the smart contract.