{"id":30117322,"url":"https://github.com/distributed-lab/vortex-rs","last_synced_at":"2025-08-10T10:41:22.362Z","repository":{"id":302472195,"uuid":"1012550274","full_name":"distributed-lab/vortex-rs","owner":"distributed-lab","description":"The Vortex List Polynomial Commitment Scheme (Vortex LPCS) Rust implementation","archived":false,"fork":false,"pushed_at":"2025-07-16T10:58:20.000Z","size":1255,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-17T14:50:19.940Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/distributed-lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-02T13:58:10.000Z","updated_at":"2025-07-16T10:58:24.000Z","dependencies_parsed_at":"2025-07-02T15:42:14.500Z","dependency_job_id":"52e09245-0ad6-49a9-af2a-04ae59dc254d","html_url":"https://github.com/distributed-lab/vortex-rs","commit_stats":null,"previous_names":["distributed-lab/vortex-rs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/distributed-lab/vortex-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/distributed-lab%2Fvortex-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/distributed-lab%2Fvortex-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/distributed-lab%2Fvortex-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/distributed-lab%2Fvortex-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/distributed-lab","download_url":"https://codeload.github.com/distributed-lab/vortex-rs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/distributed-lab%2Fvortex-rs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269712884,"owners_count":24463215,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-10T10:41:20.842Z","updated_at":"2025-08-10T10:41:22.332Z","avatar_url":"https://github.com/distributed-lab.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vortex PCS Rust implementation\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Pull Requests welcome](https://img.shields.io/badge/PRs-welcome-ff69b4.svg?style=flat-square)](https://github.com/distributed-lab/vortex-rs/issues)\n\u003ca href=\"https://github.com/distributed-lab/vortex-rs\"\u003e\n\u003cimg src=\"https://img.shields.io/github/stars/distributed-lab/vortex-rs?style=social\"/\u003e\n\u003c/a\u003e\n\n⚠️ __Please note - this crypto library has not been audited, so use it at your own risk.__\n\n## Abstract\n\nThis implementation leverages Poseidon2 hash function for Merkle tree and RingSIS hash implementation (it has been\nrewritten\nfrom [Gnark's implementation](https://github.com/Consensys/gnark-crypto/blob/master/field/koalabear/sis/sis.go)) for\nhashing columns. On the x86 architecture which enables AVX optimization the implementation leverages dynamic RingSIS\nlibrary compiled from Go version mentioned above. It also leverages KoalaBear prime field and its 4-degree extension.\nThe field, Poseidon2 and DFT implementations are taken from [Plonky3](https://github.com/Plonky3/Plonky3) repository.\n\nThe original paper can be found [here](https://eprint.iacr.org/2024/185).\n\nNote, the brunch [poseidon2-edition](https://github.com/distributed-lab/vortex-rs/tree/poseidon2-edition) contains\nimplementation that leverages on only Poseidon2 hash for both column hashing and Merkle tree.\n\n## Usage\n\nThe following parameters have to be set up:\n\n```rust\npub struct VortexParams {\n    perm: PoseidonHash, // An instance of PoseidonHash\n    r_sis: RSis, // An instance of RingSis hash\n    nb_row: usize, // Number of rows in commitment matrix\n    nb_col: usize, // Number of columns or a polynomial degree\n    rs_rate: usize, // Reed-Solomon code rate\n    num_columns_to_open: usize, // Number of columns to open in the opening phase\n}\n```\n\nUse the following functions to commit/evaluate/open and verify:\n\n1. Commit\n   ```rust\n      pub fn commit(params: \u0026VortexParams, w: Vec\u003cVec\u003cKoalaBear\u003e\u003e) -\u003e (MerkleTree, Vec\u003cVec\u003cKoalaBear\u003e\u003e)\n    ```\n2. Eval\n   ```rust\n      pub fn eval(params: \u0026VortexParams, w: \u0026Vec\u003cVec\u003cKoalaBear\u003e\u003e, coin: KoalaBearExt) -\u003e Vec\u003cKoalaBearExt\u003e\n    ```\n3. Open\n   ```rust\n      pub fn open(params: \u0026VortexParams, w: \u0026Vec\u003cVec\u003cKoalaBear\u003e\u003e, w_: \u0026Vec\u003cVec\u003cKoalaBear\u003e\u003e, mt: \u0026MerkleTree, beta: KoalaBearExt, column_ids: Vec\u003cusize\u003e) -\u003e OpenProof\n    ```\n4. Verify proof\n   ```rust\n      pub fn verify(params: \u0026VortexParams, proof: OpenProof, root: Digest, y: Vec\u003cKoalaBearExt\u003e, coin: KoalaBearExt)\n    ```\n\nThe verification function asserts if proof is invalid. The implementation is fixed over KoalaBear field and its\n4-degree extension. Check tests in [lib.rs](./src/lib.rs) for more details.\n\n## Benchmarks\n\n### ARM\n\nRun command:\n\n```shell\ncargo test test_vortex_full --features nightly-features --release -- --show-output\n```\n\nThe following benches are taken on the M3 Pro 36GB MacBook comparing to the Golang implementation\nfrom [gnark-crypto](https://github.com/Consensys/gnark-crypto/blob/master/field/koalabear/vortex/prover_test.go#L232)\n\nAll tests are performed for $2^{19}$ polynomials of $2^{11}$ degree according\nto [official benchmarks](https://hackmd.io/@YaoGalteland/SJ1WmzgTJg).\n\n|            | Gnark  | Rust   |\n|------------|--------|--------|\n| Commit     | ~31s   | ~9s    |\n| Open Proof | 1.5-2s | ~1.1s  |\n| Verify     | ~250ms | ~850ms |\n\n### x86\n\nRun command:\n\n```shell\nexport LD_LIBRARY_PATH=$(pwd)/native/libs\nRUSTFLAGS=\"-Ctarget-cpu=native\" cargo +nightly test --features nightly-features --release test_vortex_full -- --show-output\n```\n\nThe following benches are taken on the Intel(R) Xeon(R) Gold 6455B 32 CPU (1 thread per core) comparing to the Golang\nimplementation\nfrom [gnark-crypto](https://github.com/Consensys/gnark-crypto/blob/master/field/koalabear/vortex/prover_test.go#L232)\n\nAll tests are performed for $2^{19}$ polynomials of $2^{11}$ degree according\nto [official benchmarks](https://hackmd.io/@YaoGalteland/SJ1WmzgTJg).\n\n|            | Gnark  | Rust   |\n|------------|--------|--------|\n| Commit     | ~3.9s  | ~4.5s  |\n| Open Proof | 1.5 s  | ~360ms |\n| Verify     | ~400ms | ~130ms |\n\n## Definition\n\nImagine we have a list of polynomials $f_0,\\dots,f_{k-1}$. We want to commit them and evaluate at the same point at the\nsame time. We describe each polynomial as vector $a_i$ where\n\n$$\nf_i(x) = \\sum_{j=0}^{n-1} x^j\\cdot a_{i,j}\n$$\n\nFor simplicity, let's define the interpolation function $Int$ that works as follows (it takes the vector elements as\npolynomial coefficients and evaluates it at point $x$):\n\n$$\nInt_{a_i}(x) = f_i(x)\n$$\n\nThen, we organize these vectors into the matrix $W \\in \\mathbb{F}^{k\\times n}$.\n\n![](./assets/vortex1.png)\n\nWe extend our matrix with additional columns by replacing each word $a_i$ with its codeword $a_i'$,\nresulting in a matrix $W' \\in \\mathbb{F}^{k\\times m}$, where $m \u003e n$.\n\nThen we hash each column, receiving $m$ values of $h_i$ — we will use these values as our commitment to the polynomials\n$f_i$.\n\n![](./assets/vortex1_5.png)\n\n### Open\n\nGiven input $r$ from the verifier, the prover responds with values $y_0,\\dots,y_{k-1}$ where\n\n$$\ny_i = f_i(x)\n$$\n\n### Prove \u0026 Verification\n\n* The verifier samples a challenge $\\beta$\n* The prover responds with $u = B\\cdot W$, where $B = (1, \\beta, \\beta^1,\\dots,\\beta^{k-1})$. Note that naturally, each\n  element in $u$ equals to the sum of corresponding polynomials' coefficients over corresponding weight -- polynomial\n  $i$ will be multiplied by $\\beta^i$.\n  ![](./assets/vortex2.png)\n* Then, the verifier samples $t$ indexes $q_1,\\dots,q_t$ where $q_i \\in [m]$\n* The prover opens the corresponding columns $s_1,\\dots,s_t$ from the matrix $W'$\n  ![](./assets/vortex3.png)\n* The verifier computes the Reed-Solomon encoding of $u$ named $u'$.\n* The verifier checks:\n    * $hash(s_i) == h_{q_i}$ for each $i\\in [t]$\n    * $B\\cdot s_i == u'_{q_i}$ → this follows from the linearity of Reed-Solomon\n* The verifier checks that $Int_u(x) = B\\cdot y$. This check follows from the following observation: $a\\cdot Int_c(x) =\n  Int_{a\\cdot c}(x)$, so:\n    * $1 \\cdot Int_{w_0}(x) = 1 \\cdot y_0$ → $Int_{u_0}(x) = 1 \\cdot y_1$\n    * $\\beta \\cdot Int_{w_1}(x) = \\beta \\cdot y_1$ → $Int_{u_1}(x) = \\beta \\cdot y_1$\n    * $\\beta^2 \\cdot Int_{w_2}(x) = \\beta^2 \\cdot y_2$ → $Int_{u_2}(x) = \\beta^2 \\cdot y_2$\n    * etc.\n\nThe parameter $t$ is selected according to the security parameters.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdistributed-lab%2Fvortex-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdistributed-lab%2Fvortex-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdistributed-lab%2Fvortex-rs/lists"}