> For the complete documentation index, see [llms.txt](https://milaforge.gitbook.io/home/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://milaforge.gitbook.io/home/rust/rust.md).

# Near Protocol

Contributions to a production cryptography implementation, spanning cryptographic performance, protocol correctness, Rust type design, testing, and security.

> **Repository history:** This work was originally contributed to `near/threshold-signatures`. In February 2026, NEAR migrated the project into the `near/mpc` monorepo. Original PR pages were not preserved, but the merged commits and author attribution remain in the official `near/mpc` history.

## General

**Performance optimization**

* Batch Lagrange coefficient computation — [754e7d7](https://github.com/near/mpc/commit/754e7d7e05f115a37ab7469c8f70821b931349b8) - [Archived PR #50](https://web.archive.org/web/20250906061254/https://github.com/near/threshold-signatures/pull/50)
  * \~5× faster coefficient computation / \~80× faster batch inversion

**Protocol correctness**

* More specific initialization errors — [00a022a](https://github.com/near/mpc/commit/00a022a8818bbf5ecddbfdef22c3d1ccbca1722c)
* `AppId` type-safety and `Arc` optimization — [91b7db9](https://github.com/near/mpc/commit/91b7db91ef22f26304f91316019d418a4a900900)

**Testing & Engineering Quality**

* Safer threshold calculation — [657a2e4](https://github.com/near/mpc/commit/657a2e4992ed9759ed5cd248e3004ff823a78783)
* Protocol edge cases — [9ae5cc9](https://github.com/near/mpc/commit/9ae5cc901ecc517ea84539850d1e3c1383605562)
* Protocol correctness / testing / CI / `cargo-deny` checks — [b632779](https://github.com/near/mpc/commit/b63277907d80d5684ee40e783c795d8a56ff0df3)

## Security

**Waitpoint Flood DoS**

I produced a reproducible proof of concept showing that an attacker could inject fake waitpoints and fill the message buffer.

This required me to:

> Protocol-level analysis → identify attack surface → [construct exploit](https://github.com/near/mpc/commit/4d8596bdf9cfc354105ff71a15235cc683a7ee66) → reproduce vulnerability → communicate finding

***

**Timing Attack -&#x20;*****Constant-Time Cryptography***

I identified `variable-time` operations in cryptographic code and [addressed them](https://github.com/near/mpc/commit/7f70e61e48b2aefd4321f4090de107eda5190f31) using `constant-time` comparisons/checks.

This is a side-channel risk reduction at implementation leve&#x6C;**.**

***

**Malformed `AppId` Crash**

A [malformed input](https://github.com/near/mpc/commit/f89b1c9a0373724c3ad7cfc4310c8a0af5e68fed) could crash a local MPC node.

This is adversarial input analysis and robustness testing.
