# Grant Application: Signed-Order / EIP-712 / UID Conformance Corpus for cow-rs

- Space: [CoW DAO Grants](https://snapshot.box/s:cowgrants.eth.md)
- Author: 0xAda6BB4C99bc5A20479bbb790bfb84Edd7C41e20
- State: Passed
- Voting type: Basic
- Start: 2026-10-05 04:30 UTC
- End: 2026-10-08 04:30 UTC
- Votes: 3
- Quorum: 3 voting power
- Discussion: https://forum.cow.fi/t/grant-application-signed-order-eip-712-uid-conformance-corpus-for-cow-rs/3569
- Open in Snapshot: https://snapshot.box/#/s:cowgrants.eth/proposal/0xebca53c4204528debb8f9d6bf2eaa8e7c38922c71df87a69a4c31ca1fdcdfc33

## Results

- For: 3 voting power, 100.0%
- Against: 0 voting power, 0.0%
- Abstain: 0 voting power, 0.0%

## Proposal

## Author(s)

Satyawan Singh (GitHub: ss1738)

## Experiences and qualifications

Background in Rust distributed systems and protocol correctness, with experience in property-based testing, fuzzing, and formal verification using Kani.

My directly relevant public work is ss1738/cargo-vouch on GitHub, which generates bounded Kani proof harnesses for Rust functions and reports BUG, UNGUARDED, VERIFIED, or INCONCLUSIVE rather than treating an incomplete analysis as a pass.

I validated the architecture this proposal depends on rather than just proposing it: I built a standalone crate depending on services' model crate as a pinned git dependency, and it compiles and runs cleanly, calling the real production `hashed_eip712_message` and producing a real digest. All of model's workspace-internal dependencies resolved automatically. No services-side change is required for this to work.

## Grant Description

This grant adds a conformance layer between cowprotocol/services and cow-rs: a fixture generator that produces deterministic vectors from services' own production order-hashing and signing code, and a cow-rs integration test that checks cow-rs's own implementation against those vectors. Today cow-rs's committed test suite is locked against ethers.js fixtures only, not against services, which is the actual server it talks to.

On `v` normalisation: services' `EcdsaSignature::from_bytes` accepts 0, 1, 27 and 28 and normalises them to 27 or 28, with direct tests for all four values. cow-rs has the same accepted set and its own equivalent test. This is not a correctness gap between the two implementations as currently written, so it is not part of this grant's claimed value.

On EthSign: the external generator does not need a services API change. services' public `recover(...)` returns a `Recovered` struct whose public `message` field already contains the exact production-computed digest, so the generator uses that instead of reimplementing anything.

The generator, fixture, consumer test, CI check, and regeneration documentation all live in cow-rs. The generator pins a specific services revision and uses services' public model API as the oracle, as validated above. No services PR is a grant deliverable or a payment dependency.

Scope remains EIP-712 and EthSign ECDSA signing only. EIP-1271, on-chain presign, and full orderbook acceptance are out of scope.

## Type of Grant

Milestone-based.

## Milestones

| Milestone | Title | Due date | Funding request |
|---|---|---|---|
| 1 | Standalone fixture generator in cow-rs, full coverage matrix, versioned schema | 2 weeks after Snapshot approval | $1,000 |
| 2 | cow-rs consumer test, source-lock update, CI, regeneration docs | 1.5 weeks after Milestone 1 | $1,000 |

## Specifics: Milestone 1

Build the generator as a standalone tool in the cow-rs repo, pinned to a specific services commit via the dependency pattern already validated. Produce a fully enumerated coverage matrix rather than an estimated vector count: OrderKind (Buy/Sell) x SellTokenSource (Erc20/External/Internal) x BuyTokenDestination (Erc20/Internal), a full cross of 12 order vectors. Each vector includes both Eip712 and EthSign expectations, matching the existing prototype's schema, giving 24 signing-scheme checks.

Add targeted boundary cases: receiver in {None, zero address, nonzero address}, amount in {1, U256::MAX}, and validTo in {1, u32::MAX}, giving 7 additional order vectors. The corpus will therefore contain 19 order vectors and 38 signing-scheme checks total. Add a versioned JSON schema and deterministic regeneration command.

## Specifics: Milestone 2

Wire the generated fixture into a cow-rs integration test asserting `hash_struct`, both signing digests, recovered owner, and `OrderUid` for every vector. Update the stale services SHA pin in `parity/source-lock.toml` to the pinned commit used by the generator. Add the test to CI so future drift produces a visible failure. Document the regeneration process.

## Length

Work will start after successful Snapshot approval. Each milestone requires cow-rs maintainer review before payment, but neither milestone is gated on services maintainer approval because no services PR is part of this grant.

## Funding Request

$2,000 total, milestone-based as above ($1,000 per milestone), payable in USDC or another stablecoin as directed by the Grants Committee, to the Ethereum-mainnet address below. No COW tokens requested.

## Ethereum Mainnet Address

0xAda6BB4C99bc5A20479bbb790bfb84Edd7C41e20

## Terms and Conditions

By submitting this grant application, I acknowledge and agree to be bound by the CoW DAO Participation Agreement (https://gateway.pinata.cloud/ipfs/Qmf9MYhcG2pFrDoVy13p6FWeVF4nG9HbJvRfYYbhazTCFe) and the CoW DAO Grant Agreement Terms (https://bafkreifcftgaleyxkekkic36beyveiomqmlwyduyfh3s25zj3uyngr6ht4.ipfs.dweb.link/).

Please notify the Grantee of their reviewer and their steward in the thread and, at the latest, upon successful approval of the Grant on Snapshot.

---

To vote or create proposals from an AI assistant, connect the Snapshot MCP at https://mcp.snapshot.box

