|
| 1 | + |
| 2 | +# InkBench |
| 3 | + |
| 4 | +- **Team Name:** MeshPort Labs |
| 5 | +- **Payment Details:** |
| 6 | + - **DOT**: 15o24agCBihRyUrb3Sv4nQqVuJunVW1CJ4NQFBU13LMjbMTt (65% in DOT) |
| 7 | + - **USDC**: 15o24agCBihRyUrb3Sv4nQqVuJunVW1CJ4NQFBU13LMjbMTt |
| 8 | +- **[Level](https://github.com/w3f/Grants-Program/tee/master#level_slider-levels):** 2 |
| 9 | + |
| 10 | +## Project Overview :page_facing_up: |
| 11 | + |
| 12 | +### Overview |
| 13 | + |
| 14 | +**Tagline:** *Reusable benchmarking library with CLI and API interfaces for comparing Solidity vs ink! smart contracts on pallet-revive.* |
| 15 | + |
| 16 | +**Description:** |
| 17 | +InkBench is a **Rust-based benchmarking framework** that leverages **pallet-revive** as the execution engine for running Solidity and ink! smart contracts on PolkaVM. |
| 18 | + |
| 19 | +The **core deliverable is a library** that standardizes how contracts are deployed, executed, and benchmarked on pallet-revive. This library is then used to build: |
| 20 | + |
| 21 | +* A **CLI tool** for reproducible developer and CI/CD workflows. |
| 22 | +* A **Web API service** to expose benchmark results and enable visualization dashboards. |
| 23 | +* A **Web App** where users can drop their contracts and benchmark them. |
| 24 | + |
| 25 | +**Relation to ink! ecosystem:** |
| 26 | +By quantifying the performance advantages of ink! (64-bit arithmetic, SCALE ABI) compared to Solidity, InkBench will provide empirical evidence supporting ink! adoption and tooling integration. |
| 27 | + |
| 28 | + |
| 29 | +### Project Details |
| 30 | + |
| 31 | +**Abstractions and Core Capabilities** |
| 32 | + |
| 33 | +Our library will **standardize the process of deploying, executing, and recording benchmarks** for both ink! and Solidity contracts by building directly on top of **pallet-revive**. At a high level, the library will provide three essential abstractions: |
| 34 | + |
| 35 | +1. **Contract Lifecycle Management** |
| 36 | + |
| 37 | + * **Deployment:** Using pallet-revive’s instantiation API, we will deploy identical contracts (e.g., Incrementer, ERC20, upgradeable proxy) written in both ink! and Solidity. This ensures a fair baseline for comparing contract size and constructor overhead. |
| 38 | + * **Execution:** We will invoke methods on deployed contracts through revive’s low-level call interface. Each execution returns metrics such as gas consumed, gas required, and whether the call reverted. |
| 39 | + |
| 40 | +2. **Benchmark Scenarios** |
| 41 | + We will design a suite of **standardized scenarios** that allow us to directly compare Solidity vs ink! under controlled conditions: |
| 42 | + |
| 43 | + * **Storage Operations:** |
| 44 | + |
| 45 | + * Writing to storage slots |
| 46 | + * Reading values from storage |
| 47 | + * Updating large mappings or arrays |
| 48 | + → Goal: quantify differences in gas usage and execution time. |
| 49 | + * **Arithmetic Operations:** |
| 50 | + |
| 51 | + * ink! (64-bit word size) vs Solidity (256-bit word size) |
| 52 | + * Benchmarks will involve repeated additions, multiplications, and modular arithmetic. |
| 53 | + → Goal: demonstrate performance impact of PolkaVM’s reduced word size advantage in ink!. |
| 54 | + * **Cross-Contract Calls:** |
| 55 | + |
| 56 | + * Nested calls (e.g., ERC20 `transfer` calling into another contract, or proxy delegation). |
| 57 | + → Goal: measure overhead of cross-contract communication. |
| 58 | + * **Contract Size Comparison:** |
| 59 | + |
| 60 | + * Compile identical functionality (ERC20, incrementer, upgradeable proxy) in ink! and Solidity. |
| 61 | + * Compare the size of resulting `.polkavm` binaries. |
| 62 | + → Goal: evaluate deploy-time footprint and storage cost of contracts. |
| 63 | + * **ABI Efficiency:** |
| 64 | + |
| 65 | + * ink!’s SCALE ABI vs Solidity’s ABI. |
| 66 | + * Benchmark function calls with structured data, arrays, and nested structs. |
| 67 | + → Goal: measure how SCALE’s compact encoding reduces gas and size overhead. |
| 68 | + |
| 69 | +3. **Metrics & Results** |
| 70 | + For every benchmark, we will record and compare across dimensions: |
| 71 | + |
| 72 | + * **Gas Usage:** Actual vs required gas per call. |
| 73 | + * **Execution Time:** Nanosecond-level timing within the runtime. |
| 74 | + * **Contract Size:** Compiled `.polkavm` bytecode size. |
| 75 | + * **ABI Overhead:** Relative cost of SCALE vs Solidity ABI encoding. |
| 76 | + |
| 77 | + **Output Formats** |
| 78 | + |
| 79 | +* Results will be exported in **JSON** for programmatic use (API, dashboards) and **CSV** for CLI/CI pipelines. |
| 80 | +* This ensures benchmarks are both reproducible and easy to visualize. |
| 81 | + |
| 82 | + |
| 83 | +--- |
| 84 | + |
| 85 | +**API Service** |
| 86 | +The API service exposes benchmarking capabilities over HTTP, enabling developers, researchers, and teams to: |
| 87 | + |
| 88 | +* Run predefined benchmark suites remotely. |
| 89 | +* Submit compiled contracts (ink!/Solidity `.polkavm`) for testing. |
| 90 | +* Fetch benchmark results in structured JSON. |
| 91 | + This allows automated workflows, integrations, and research use cases without requiring local runtime setup. |
| 92 | + |
| 93 | +--- |
| 94 | + |
| 95 | +**Web App** |
| 96 | +The Web App is a **user-friendly dashboard** for non-technical and community use. |
| 97 | + |
| 98 | +* Upload contracts (ink!/Solidity) and benchmark them directly. |
| 99 | +* Visualize results (gas usage, execution time, contract size, ABI overhead) in charts and tables. |
| 100 | +* Preloaded examples (ERC20, incrementer, upgradeable proxy) for easy exploration. |
| 101 | +* Export results as JSON/CSV. |
| 102 | + This makes benchmarking accessible to hackathon participants, ecosystem teams, and decision-makers without requiring CLI/API knowledge. |
| 103 | + |
| 104 | +--- |
| 105 | + |
| 106 | +**Documentation** |
| 107 | + |
| 108 | +* Inline Rustdoc for the library. |
| 109 | +* Tutorials for using the CLI locally and in CI/CD. |
| 110 | +* API usage guide for integrating benchmarks into external systems. |
| 111 | +* Web App user guide for uploading contracts and interpreting results. |
| 112 | + |
| 113 | + |
| 114 | +### Technology Stack |
| 115 | + |
| 116 | +* **Core**: Rust, pallet-revive, Polkadot SDK, sp_io::TestExternalities (for deterministic runtime benchmarks). |
| 117 | + |
| 118 | +* **CLI Tool**: Rust, Clap-rs, polkadot-sdk. |
| 119 | + |
| 120 | +* **API Service**: Rust (Axum/Actix) wrapping library functions as HTTP endpoints. That we will build a dashboard |
| 121 | + |
| 122 | +* **Web App** : Nextjs website for uploading contracts and running benchmarks. |
| 123 | + |
| 124 | + |
| 125 | +* **PoC:** |
| 126 | + |
| 127 | + * Ink! and Solidity incrementer contracts already compiled to PolkaVM. |
| 128 | + * Benchmarking runtime implemented using pallet-revive (`bare_instantiate`, `bare_call`). |
| 129 | + * Repository: [ItshMoh/inkBench](https://github.com/ItshMoh/inkBench). |
| 130 | + |
| 131 | +* **Business Model:** |
| 132 | + |
| 133 | + * Open-source infrastructure. |
| 134 | + * Positioned as a community tool and research enabler. |
| 135 | + |
| 136 | +--- |
| 137 | + |
| 138 | +### Ecosystem Fit |
| 139 | +This project addresses a community need identified in the [ink! RFP for Benchmarking Tools](https://github.com/use-inkubator/Ecosystem-Grants/blob/cmichi-update-rfp-benchmark/request-for-proposals.md#%EF%B8%8F-benchmark-solidity-vs-ink-on-pallet-revive). The ink! ecosystem lacks a standardized framework to compare ink! and Solidity contract performance on pallet-revive. This tool will provide developers with data-driven insights for informed language selection in smart contract development. The maintainer of the Ecosystem Grants (Michael Müller) have share his thought on the proposal |
| 140 | + |
| 141 | +> Your project would certainly be very valuable and your outline also looks good, so we'd like to encourage you to resubmit it in coming rounds of the ink!ubator |
| 142 | +
|
| 143 | +because of the lack of fund of the current inkubator grant it has not moved forward |
| 144 | +[see the thought here](https://github.com/use-inkubator/Ecosystem-Grants/pull/94#issuecomment-3487440257) our proposal. |
| 145 | + |
| 146 | +--- |
| 147 | + |
| 148 | +### Ink! Ecosystem Impact |
| 149 | + |
| 150 | +* **Developers:** Run benchmarks locally or in CI using the CLI. |
| 151 | +* **Ecosystem Maintainers:** Integrate benchmarks into ink!’s CI/CD and documentation. |
| 152 | +* **Adoption Impact:** Demonstrate ink!’s efficiency with clear metrics and visual comparisons against Solidity. |
| 153 | +* **Researchers:** Use the API and exported datasets for academic or performance studies. |
| 154 | + |
| 155 | +--- |
| 156 | + |
| 157 | +--- |
| 158 | + |
| 159 | +## Team :busts_in_silhouette: |
| 160 | + |
| 161 | +### Team Members |
| 162 | + |
| 163 | +* **Team Lead:** Mohan Kumar |
| 164 | + |
| 165 | +### Contact |
| 166 | + |
| 167 | +* **Contact Name:** Mohan Kumar |
| 168 | + |
| 169 | + |
| 170 | +### Legal Structure |
| 171 | + |
| 172 | +- We don't have a legal structure yet. We are a group of developers that want to build cool stuff. We will create a legal structure for future work and projects. |
| 173 | + |
| 174 | +### Team's experience |
| 175 | + |
| 176 | +Mohan has 3 years of experience in Full Stack Development, working as an AI Engineer and Software Development. |
| 177 | + |
| 178 | +He has participated in many hackathons and some web3 hackathons, also winning some of them. He has also contributed to a lot of open Source Projects(Like [AsyncAPI](https://github.com/asyncapi), [Floresta](https://github.com/vinteumorg/Floresta)) |
| 179 | + |
| 180 | +Currently this is the [POC](https://github.com/ItshMoh/inkBench) that he is working on. |
| 181 | + |
| 182 | +### Team Code Repos |
| 183 | + |
| 184 | +* [https://github.com/ItshMoh/inkBench](https://github.com/ItshMoh/inkBench) |
| 185 | +* [https://github.com/ItshMoh/](https://github.com/ItshMoh/) |
| 186 | + |
| 187 | + |
| 188 | +## Development Status :open_book: |
| 189 | + |
| 190 | +* PoC cli implemented where we have a CLI to deploy, call, and benchmark contracts. |
| 191 | +* Contracts compiled to PolkaVM and deployed on pallet-revive. |
| 192 | + |
| 193 | +--- |
| 194 | + |
| 195 | +## Development Roadmap :nut_and_bolt: |
| 196 | + |
| 197 | +### Overview |
| 198 | + |
| 199 | +* **Total Estimated Duration:** 3 months |
| 200 | +* **Full-Time Equivalent (FTE):** 4 |
| 201 | +* **Total Costs:** 30,000 USD |
| 202 | + |
| 203 | +--- |
| 204 | + |
| 205 | +### Milestone 1 — Core Library (pallet-revive integration) + CLI Tool |
| 206 | + |
| 207 | +* **Estimated Duration:** 1.5 months |
| 208 | +* **FTE:** 2 |
| 209 | +* **Costs:** 15,000 USD |
| 210 | + |
| 211 | +| Number | Deliverable | Specification | |
| 212 | +| ------: | ------------------------ | ------------------------------------------------------------------------------- | |
| 213 | +| **0a.** | License | Apache 2.0 | |
| 214 | +| **0b.** | Documentation | Inline docs, usage examples. | |
| 215 | +| **0c.** | Testing | Unit + integration tests with pallet-revive. | |
| 216 | +| **0d.** | Docker | Containerized test runtime for reproducibility. | |
| 217 | +| **1.** | Rust Library Crate | Core API: deploy, call, measure (via `Revive::bare_instantiate` + `bare_call`). | |
| 218 | +| **2.** | Gas Benchmarks | Storage read/write, cross-contract calls. | |
| 219 | +| **3.** | Arithmetic Benchmarks | ink! (64-bit) vs Solidity (256-bit). | |
| 220 | +| **4.** | Contract Size Benchmarks | Measure `.polkavm` binary sizes for ink! vs Solidity. | |
| 221 | +| **5.** | CLI `revive-bench` | Commands to deploy, call, and benchmark contracts. | |
| 222 | +| **6.** | ERC20 Benchmarks | Compare ink! vs Solidity ERC20 implementations. | |
| 223 | +| **7.** | Output Serialization | JSON + CSV export of benchmark results. | |
| 224 | +| **8.** | CI Integration | Example workflows (GitHub Actions). | |
| 225 | +--- |
| 226 | + |
| 227 | +### Milestone 2 — Web API + Frontend Application |
| 228 | + |
| 229 | +* **Estimated Duration:** 1.5 month |
| 230 | +* **FTE:** 2 |
| 231 | +* **Costs:** 15,000 USD |
| 232 | + |
| 233 | +| Number | Deliverable | Specification | |
| 234 | +| ---------: | ------------------------- | --------------------------------------------------- | |
| 235 | +| **0a–0d.** | Standard deliverables | License, docs, tests, Docker. | |
| 236 | +| 1. | Web API Service | HTTP API wrapping the library for running benchmarks. | |
| 237 | +| 2. | Upgradeable Contracts | Benchmark proxy/upgradeable pattern. | |
| 238 | +| 3. | ABI Efficiency Benchmarks | Compare SCALE ABI vs Solidity ABI encoding. | |
| 239 | +| 4. | Web Frontend (React) | UI where users upload ink!/Solidity contracts. | |
| 240 | +| 5. | Benchmark Runner Integration | Frontend communicates with Web API to run benchmarks. | |
| 241 | +| 6. | Visualization | Interactive charts/tables showing gas usage, contract size, and ABI efficiency. | |
| 242 | +| 7. | Report Article | Publish tutorial + benchmark results using the Web App. | |
| 243 | + |
| 244 | + |
| 245 | + |
| 246 | +## Future Plans |
| 247 | + |
| 248 | +* Extend benchmarks to DeFi/NFT contract patterns. |
| 249 | +* Maintain a hosted public dashboard for ongoing comparisons. |
| 250 | +* Collaborate with ink! maintainers to integrate benchmarks into official CI. |
| 251 | + |
| 252 | +--- |
| 253 | + |
| 254 | +## Additional Information \:heavy\_plus\_sign: |
| 255 | + |
| 256 | + |
| 257 | +* **Work already done:** [InkBench PoC](https://github.com/ItshMoh/inkBench). |
| 258 | +* **Collaboration:** Open to syncing with ink! CI maintainers for integration. |
0 commit comments