EVM OCW (Off Chain Worker) Bridge to Bluzelle
evm, ethereum, bridge, ocw, off chain worker, oracle, database, crud, cosmos
### Prize Title
EVM OCW (Off Chain Worker) Bridge to Bluzelle
### Prize Bounty
$7,500 USD worth of ERC20 BLZ, at time of payout
### Challenge Description
Bluzelle provides decentralized data services, powered by the Cosmos blockchain. Our services include a key-value-store (CRUD), oracle, and NFT. We are also building toward providing support to EVM (Ethereum Virtual Machine) and Polkadot support for our services. Our bounties reflect our aggressive approach to consistently improve our ecosystem and value proposition.
While the Hackathon has a specific start and end date, we are ok with work continuing after the hackathon, for the chosen winners to finish their projects to our standards.
A challenge right now for smart contract developers on an EVM (Ethereum, BSC, etc), is their inability to get simplified access to Bluzelle's plethora of services (specifically DB and Oracles). Bluzelle offers an oracle and a key value store. It would be valuable for a smart contract to query Bluzelle's oracle for the value of something like the price of the BTC/USD pair, or to ask for the value of a key in the Bluzelle key-value store DB, such as the "name" field in the "ABC" database, where name is say "Alice". For the sake of simplicity, we assume only reads happen -- the EVM cannot write to Bluzelle in any way.
Accessing the Bluzelle services mentioned here require the same fundamental technology. We foresee a smart contract in the EVM that allows transactions to be called on it, such as "getOracleValue" or "getDBValue". The smart contract must explicitly collect sufficient ETH (or BNB or whatever) native to the EVM, so that the response can be posted back. The smart contract must also collect a callback that it will invoke when the answer comes back.
Once the request is made to this smart contract, the smart contract will likely emit an event. Then, an external process (the OCW) would listen for these EVM events, parse them, and goto Bluzelle and make the request (ie: read the oracle value or the database value). The OCW will then take the response and post it back as a transaction to the same smart contract invoked by the developer. This transaction will also invoke the callback registered for that request, to let the calling method get its reply. The OCW will use ETH from a pool it has providence over, to pay the gas for these fees.
Note that the smart contract must keep track of how much ETH was paid by the developer. This is the ETH (minus a small fee, perhaps) that is used as an upper limit by the OCW when it is posting the reply. This ensures the developers are fairly paying for the work done to process their request but more importantly, covering the gas necessary to post the reply back. If the developer is stingy and does not provide enough ETH, the callback could run out of gas, meaning no reply to the request will ever be posted.
The deliverables here would be the smart contract, the OCW, and documentation. Huge bonus marks if this OCW itself can somehow be decentralized, where it is somehow running in a decentralized redundant "server-less" like environment that requires little management and upkeep. This ideal would allow the entire flow to be decentralized and immune from downtime and attack.
It is expected that this is fully demoed to work with the Ropsten network working in tandem with Bluzelle’s testnets, showing off use of Bluzelle’s DB and Oracle services.
Our JS library:
To install our libraries:
install @bluzelle/sdk-js with “yarn” or “npm”
### Submission Requirements
The submission should include sufficiently QA’d documentation on how to deploy the service/product, and how to use the submission as per the requirements of the bounty.
These should include documentation on the commands to be used to interact with the submission, and how the submission is configured to work properly with BluzelleDB, etc.
A video demo should be included. It would nice to have a voice-over in English where we can fully understand the submission, but this is not a strict requirement. A computer-generated voice over is ok too, if you prefer.
The demo should also walk through the code and explain all the items that are being provided. The demo should walk through the process of deploying the submission, and how to use it, etc.
It is expected that the documentation is accurate. We will follow your documentation, to properly evaluate the submission. If it is incorrect, we may be unable to fairly evaluate your submission.
Including tests with your submission will greatly improve your chances of winning. We like to run tests that are highly verbose and explicit in terms of what they are doing, so we can gain confidence in the correctness of what you have submitted. If you provide tests and expect us to run them, like everything else, document it well, and ensure that the tests can be run by us -- give us the steps to setup and run the tests.
If the documentation is incomplete or incorrect, there is a possibility that we may not be able to fairly assess the submission, as we will walk through the documentation to validate the project. Due to practical limitations on time and resources, once a project is submitted, we are not able to provide much assistance in correcting a project’s that may not be properly working, nor to inquire to get proper steps, if the documentation that comes with a submission is insufficient.
Your project will be judged based on what you submit. Please submit something that is complete, well thought out, and tested, from a documentation and product features and code quality standpoint. We will do our best to evaluate, but obviously, the easier you make our life, the better the chances are that you win.
WE LOVE VERBOSITY AND DOCUMENTATION. There is no such thing as too much information. Explain what you have built, and please ensure it will run CORRECTLY, when we follow your directions literally. Just doing this alone will vastly improve your chances of victory.
### Judging Criteria
Our goal is to, as part of the evaluation process, fully setup, and use your submission, successfully, and without any major hiccups.
Based on the ease of doing this and the quality of your documentation, product, code, and features, we will choose the winner.
There is no preference to ordering of submissions -- just be sure to submit them on time. Once submitted, we will evaluate and there will not be alot of opportunity for back and forth. Please ensure your submitted documentation and code is complete, enabling us to properly judge it based on its merit.
We will choose the best based on quality. Documentation and properly written code is a large part of the criteria. A project that we cannot deploy ourselves is difficult to give a prize to. We will do our best to contact you, if there is an issue. Practically, we probably won’t have much time to contact you, after submission, to get clarification or to ask you to fix a bug. It ideally should work when we judge it.
Note: While the descriptions given for bounties are quite explicit and even tend to suggest how an actual solution to each problem can be built, you as a developer have the option to architect the solution your own way. We have provided guidance on a solution we see as reasonable, but we are open to considering other solutions. Obviously, we will choose the best overall submission, based on various factors including the elegance of the solution.