Grant Application: Rust SDK for CoW Protocol

Grant Title: Rust SDK for CoW Protocol

Author: pstylez78

GitHub: PatStiles (PatStiles)

About You:

Experienced Developer in Defi, and Web3
Contributor to the Jolt ZKVM (A16z), and Arkworks-rs.

Grant Category: Protocol Order Flow / Developer tools

Grant Description:

Problem:*

Builders / developers come from many different technical backgrounds. Due to the nature of web applications predominantly being written in JavaScript, CoW Protocol naturally developed a JavaScript SDK cow-sdk. After interest from the CoW Dao community a later grant was given to build a python SDK cow-py.

Rust has become a popular backend language for many developers in crypto with various L1 ecosystems committing to its usage. Creating a Rust SDK for developers to interact with CoW protocol will aid developers using Rust as there main development language that seek to integrate CoW protocol.

Solution: This grant seeks to set aside funding within Grants DAO to fund contributors to a CoW Protocol Rust SDK.

Grant Goals and impact:

Increase CoW protocol utility by extending the current cow protocol tooling to the widely used rust programming language.
Increase CoWmunity engagement, fostering a strong developer community.

Milestones:

Phase one (feature parity):

The first phase will involve developing the CoW Rust SDK to that allows for the following:

  • Querying the CoW Protocol subgraph.
  • Managing orders on the CoW Protocol.
  • Interacting with CoW Protocol smart contracts.
  • Encoding orders metadata and pinning to CID.
  • Fetching and decoding blockchain data.
  • Generated SDK documentation using OpenAPI Codegen.

Specifically the Cow Rust SDK will achieve feature parity with:

  • a. @cowprotocol/cow-sdk
  • b. @cowprotocol/contracts (hashing utilities)
  • c. @cowprotocol/app-data

To ensure soundness, correctness, and support ease of use, the Cow Rust SDK will include unit tests, integration tests and examples as outlined within the CoW Python SDK ( cow-py/tests at main · cowdao-grants/cow-py · GitHub ).

The project will be hosted within the @cowdao-grants organization on github within a repository titled cow-rs

Phase two (maintenance):

This phase will consist of being on call and active post development to proactively triage and address bugs and feature request reported by the community.

Contributors will maintain the CoW Protocol Rust SDK over the course of a year.

Grant Timeline:

Phase one: 8 weeks

Phase two: From 1 year after Phase 1 complete.

Funding Request:

$8,500 for the first phase. Based on the Grants Committee assessment (and whose decision is final), the funding will be divided amongst the developers of the Rust SDK with funds set aside for later review and auditing.

Once the Rust SDK reaches feature parity, the orders routed by the Rust SDK will become eligible for the Volume Grants Program. Funds from the Volume Grants Program (if any), will be distributed to original developers, and maintainers, on a ratio basis to be solely determined by the Grants Committee.

Budget Breakdown:

$8.5k: development / labor cost.
Volume Grants Program
Gnosis Chain Address (to receive the grant):

Referral: N/A

Terms and conditions:

By applying for this grant, I agree to be bound by the CowDAO Participation Agreement and the COWDAO Grant Terms and Conditions

3 Likes

Hi, this looks interesting! Would it be possible for this to be implemented in a manner whereby the SDK can be no_stdcompatible?

1 Like

I do not think we could target full no_std compliance as for making network calls my plan was to utilize reqwest and tokio and they require std. alloy-rs as an example does not fully support no_std but instead adopts the strategy of separating no_std dependencies into separate crates such that you can compile parts with no_std. For the CoW Rust SDK I believe this would be a good approach.

Additionally, the CoW Rust SDK could support wasm compilation and generate js bindings for use in web apps. This is supported in Helios, ( helios/Cargo.toml at master · a16z/helios · GitHub ) as an example.

Sure, sounds good. Could we please make it wasm compatible at least?

Yes! I can include wasm compatibility as a feature in the sdk.

@mfw78 Should I update the grant and create a new forum post with updated milestones since the original post to this forum is now unable to be updated?

Sure this is fine if you want to post in the same thread again - thanks for checking!

Per @Sov’s mention above, please feel free to update / post the revised post here, detailing inclusion of a WASM target.

Grant Title: Rust SDK for CoW Protocol

Author: pstylez78

GitHub: PatStiles (PatStiles)

About You:

Experienced Developer in Defi, and Web3
Contributor to A16z Jolt ZKVM, and Arkworks-rs.

Grant Category: Protocol Order Flow / Developer tools

Grant Description:

Problem:*

Builders / developers come from many different technical backgrounds. Due to the nature of web applications predominantly being written in JavaScript, CoW Protocol naturally developed a JavaScript SDK cow-sdk. After interest from the CoW Dao community a later grant was given to build a python SDK cow-py. Rust has become a popular backend language for many developers in crypto with various L1 ecosystems committing to its usage.

Solution: This grant seeks to set aside funding within Grants DAO to fund contributors to a CoW Protocol Rust SDK.

Grant Goals and impact:

Increase CoW protocol utility by extending the current cow protocol tooling to the widely used rust programming language.
Increase CoWmunity engagement, fostering a strong developer community.

Milestones:

Phase one (feature parity):

The first phase will involve developing a CoW Rust SDK that allows for the following:

  • Querying the CoW Protocol subgraph.
  • Managing orders on the CoW Protocol.
  • Interacting with CoW Protocol smart contracts.
  • Encoding orders metadata and pinning to CID.
  • Fetching and decoding blockchain data.
  • Generating SDK documentation using OpenAPI Codegen.
  • Compiling the SDK to wasm for use in web app development.

Specifically the Cow Rust SDK will achieve feature parity with:

  • a. @cowprotocol/cow-sdk
  • b. @cowprotocol/contracts (hashing utilities)
  • c. @cowprotocol/app-data

To ensure soundness, correctness, and support ease of use, the Cow Rust SDK will include unit tests, integration tests and examples as outlined within the CoW Python SDK (cow-py/tests at main · cowdao-grants/cow-py · GitHub).

The project will be hosted within the @cowdao-grants organization on github within a repository titled cow-rs

Phase two (maintenance):

This phase will consist of being on call and active post development to proactively triage and address bugs and feature request reported by the community.

Contributors will maintain the CoW Protocol Rust SDK over the course of a year.

Grant Timeline:

Phase one: 8 weeks

Phase two: From 1 year after Phase 1 complete.

Funding Request:

$8,500 for the first phase. Based on the Grants Committee assessment (and whose decision is final), the funding will be divided amongst the developers of the rust SDK with funds set aside for later review and auditing.

Once the Rust SDK reaches feature parity, the orders routed by the Rust SDK will become eligible for the Volume Grants Program. Funds from the Volume Grants Program (if any), will be distrbuted to original developers, and maintainers, on a ratio basis to be solely determined by the Grants Committee.

Budget Breakdown:

$8.5k: development / labor cost.
Volume Grants Program
Gnosis Chain Address: 0x08681acf4721a18c49145fd66708e340e56da312:

Referral: N/A

Terms and conditions:

By applying for this grant, I agree to be bound by the CowDAO Participation Agreement and the COWDAO Grant Terms and Conditions

1 Like

@mfw78 @Sov Thank you for the feedback. I have posted the updated grant above!

Signalling my support for this grant.

Thanks @pstylez78 the grants council is ready for you to submit this to Snapshot. You can follow the instructions here to do so.

@mfw78 @Sov Thank you! Here is the Snapshot: https://snapshot.box/#/s:cowgrants.eth/proposal/0xc1fba0f5565658fce7392f8995a43149b5599472531fa8abbdc3bdaf7ad2ed5f

2 Likes