a hack implementation of CCS generic arithmetization, won a prize at Zuzalu hackathon 2023 despite incompleteness

Overview

ccs-hack

CCS (Customized Constraint System) is a generic constraints representation system can simultaneously capture R1CS, Plonkish, and AIR:

$$\sum_{i=0}^{q-1} c_i \bigcirc_{j\in S_i} M_j \cdot z = 0 $$

You can easily convert CCS to R1CS, Plonkish, Air and vice versa. You can also build proof systems that directly using CCS as the constraints system, such as HyperNova, SuperSpartan.

CCS can save (or add) the fragmentation of arithmetisations!

Screenshot 2023-05-14 at 14 12 47
Comments
  • Waylon/bugs

    Waylon/bugs

    It changes the following: Added generic params for r1cs in a spot they were missing. Also remove the local finite field implementation (arkworks probably better)

    opened by 0xJepsen 0
  • ⬆️ Update num-bigint requirement from 0.3.2 to 0.4.3

    ⬆️ Update num-bigint requirement from 0.3.2 to 0.4.3

    ⚠️ Dependabot is rebasing this PR ⚠️

    Rebasing might not happen immediately, so don't worry if this takes some time.

    Note: if you make any changes to this PR yourself, they will take precedence over the rebase.


    Updates the requirements on num-bigint to permit the latest version.

    Changelog

    Sourced from num-bigint's changelog.

    Release 0.4.3 (2021-11-02)

    Contributors: @​arvidn, @​cuviper, @​guidovranken

    Release 0.4.2 (2021-09-03)

    Contributors: @​catenacyber, @​cuviper

    Release 0.4.1 (2021-08-27)

    Contributors: @​cuviper, @​PatrickNorton

    Release 0.4.0 (2021-03-05)

    Breaking Changes

    Contributors: @​cuviper, @​Gelbpunkt

    Release 0.3.3 (2021-09-03)

    ... (truncated)

    Commits

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Update rstest requirement from 0.16 to 0.17

    Update rstest requirement from 0.16 to 0.17

    Updates the requirements on rstest to permit the latest version.

    Release notes

    Sourced from rstest's releases.

    0.17.0

    Introduce #[awt] and #[future(awt)] feature.

    Changelog

    Sourced from rstest's changelog.

    [0.17.0] 2023/3/19

    Add

    • Add #[awt] and #[future(awt)] to .await future input

    Fixed

    • Fixed wrong message when timeout tests panic before timeout expire (See #171)

    [0.16.0] 2022/11/27

    Changed

    • Show TEST START banner only when trace some argument: See #158 for details.
    • Add values to test name: See #160 for details.

    Fixed

    • Updated test fixtures to 1.64.0 compiler's error messages.

    [0.15.0] 2022/06/27

    Fixed

    • Timeout not compile if one of its test arguments il not a copy type [see #154]

    [0.14.0] 2022/06/19

    Changed

    • Feature gated async timeout via async-timeout feature [see #148]

    Fixed

    • Removed async-std build dependency [see #148]

    [0.13.0] 2022/05/15

    Add

    • #[timeout(duration)] test implementation for both sync and async tests (See #136)

    Changed

    • Split rstest in separated crates for macro and libs (See #32)

    [0.12.0] 2021/12/12

    Add

    • Add #[once] fixture attribute to create static fixtures (See #119)

    ... (truncated)

    Commits

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Update criterion requirement from 0.4 to 0.5

    Update criterion requirement from 0.4 to 0.5

    Updates the requirements on criterion to permit the latest version.

    Changelog

    Sourced from criterion's changelog.

    [0.5.0] - 2023-05-23

    Changed

    • Replaced lazy_static dependency with once_cell
    • Improved documentation of the html_reports feature
    • Replaced atty dependency with is-terminal
    • MSRV bumped to 1.64
    • Upgraded clap dependency to v4
    • Upgraded tempfile dependency to v3.5.0

    Fixed

    • Quick mode (--quick) no longer outputs 1ms for measured times over 5 seconds
    • Documentation updates

    [0.4.0] - 2022-09-10

    Removed

    • The Criterion::can_plot function has been removed.
    • The Criterion::bench_function_over_inputs function has been removed.
    • The Criterion::bench_functions function has been removed.
    • The Criterion::bench function has been removed.

    Changed

    • HTML report hidden behind non-default feature flag: 'html_reports'
    • Standalone support (ie without cargo-criterion) feature flag: 'cargo_bench_support'
    • MSRV bumped to 1.57
    • rayon and plotters are optional (and default) dependencies.
    • Status messages ('warming up', 'analyzing', etc) are printed to stderr, benchmark results are printed to stdout.
    • Accept subsecond durations for --warm-up-time, --measurement-time and --profile-time.
    • Replaced serde_cbor with ciborium because the former is no longer maintained.
    • Upgrade clap to v3 and regex to v1.5.

    Added

    • A --discard-baseline flag for discarding rather than saving benchmark results.
    • Formal support for benchmarking code compiled to web-assembly.
    • A --quiet flag for printing just a single line per benchmark.
    • A Throughput::BytesDecimal option for measuring throughput in bytes but printing them using decimal units like kilobytes instead of binary units like kibibytes.

    Fixed

    • When using bench_with_input, the input parameter will now be passed through black_box before passing it to the benchmark.

    [0.3.6] - 2022-07-06

    Changed

    • MSRV bumped to 1.49
    • Symbol for microseconds changed from ASCII 'us' to unicode 'µs'

    ... (truncated)

    Commits

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Test for Custome Constrain Systems

    Test for Custome Constrain Systems

    • [ ] test_ccs_invalid_c_length(): This test should check that is_satisfied_by returns an error when c does not have length q.
    • [ ] test_ccs_invalid_M_length(): This test should check that is_satisfied_by returns an error when M does not have length t.
    • [ ] test_ccs_invalid_x_length(): This test should check that is_satisfied_by returns an error when x does not have length l.
    • [ ] test_ccs_invalid_w_length(): This test should check that is_satisfied_by returns an error when w does not have length n - l - 1.
    • [ ] test_ccs_invalid_s_cardinality(): This test should check that is_satisfied_by returns an error when any Si in S has a cardinality greater than d.
    • [ ] test_ccs_invalid_s_value(): This test should check that is_satisfied_by returns an error when any Si in S contains a value not in the domain {0, ..., t-1}.
    test 
    opened by 0xJepsen 0
  • Tests for plonkish structure

    Tests for plonkish structure

    We should test the satisfiability for the plonkish structure in a number of ways

    • [ ] Check constraints are satisfied with small poly
    • [ ] Check constraints are not satisfied when they shouldn't be
    • [ ] Test higher degree polynomials
    test 
    opened by 0xJepsen 0
  • Benchmarks on overhead

    Benchmarks on overhead

    One thing I know the community to be quite interested in is the performance of these maps and schemes. If we are able to benchmark some examples to measure how these hold up in practice it would be a good value add.

    documentation enhancement 
    opened by 0xJepsen 0
  • Tests for R1CS check constraints

    Tests for R1CS check constraints

    Right now this is a hacked together implementation which has been a really wonderful learning tool. However to move towards production implementations it would be nice to build confidence in our implementation with a variety of tests. These would be a good place to start.

    • [ ] Test for R1CS satisfaction: This should check that the is_satisfied_by method correctly determines whether a given instance and witness satisfy the R1CS. This should include tests with both satisfying and non-satisfying instances and witnesses.
    • [ ] Test for R1CS creation: This should check that the R1CS is created correctly given valid inputs and that it correctly rejects invalid inputs. It should test the new method and verify that the assert! statements correctly enforce the constraints on the inputs.
    • [ ] Test for conversion to CCS: This should check that the to_ccs method correctly converts the R1CS to a CCS. It should test that the properties of the CCS (like its size and the properties of its multisets and constants) match what's expected based on the original R1CS.
    test 
    opened by 0xJepsen 0
Owner
Thor
zk wink
Thor
Following "ZK HACK III - Building On-chain Apps Off-chain Using RISC Zero"

RISC Zero Rust Starter Template Welcome to the RISC Zero Rust Starter Template! This template is intended to give you a starting point for building a

drCathieSo.eth 3 Dec 22, 2022
Burrow is a tool for burrowing through firewalls, built by teenagers at Hack Club.

Burrow Burrow is a tool for burrowing through firewalls, built by teenagers at Hack Club. At its core, burrow is a command line utility written in Rus

Hack Club 44 Apr 20, 2023
Keybinder to type diacrytical characters without needing to hack the layout itself. Supports bindings to the left Alt + letter

Ďíáǩříťíǩád I just thought that it's a shame the word diakritika does not have any diacritics in it. Key points diakritika is a simple Windows daemon

null 4 Feb 26, 2024
Simple RISC-V emulator presented at Rust Nation 2023

A tale of binary translation This repo contains the code for the RISC-V emulator that I presented at Rust Nation 2023. It is intended as a teaching ex

Amanieu d'Antras 34 Feb 20, 2023
Contains challenges, write-ups, and deployment configurations from b01lersCTF 2023.

CTF Name A template repository for a CTF competition. This is a description of the CTF event. CTFTime Link Structure Challenges are organized by categ

null 7 Mar 29, 2023
Sky Island Showdown: CSE 125 Spring 2023 Group 5 Project, a Multiplayer, 3D Game

As the Wind Blows ?? Project for CSE 125 Spring 2023, Group 5 Homepage » As the Wind Blows is a 3D multiplayer game, created with Rust, WGPU, and a to

null 5 May 1, 2023
GraphQL Summit 2023 Workshop Demo for Federated Subscriptions in GraphOS.

Kahoot Clone Demo App - Subgraphs Welcome to the project for GraphQL Summit 2023 "Federated Subscriptions in GraphOS" workshop! ⚠️ Before the workshop

Apollo GraphQL 4 Oct 10, 2023
rust-rustlings-2023-autumn-CAIMEOX created by GitHub Classroom

2023秋冬季操作系统训练营 第一阶段训练安排 rustlings Rust编程训练教室 rustlings ??❤️ Greetings and welcome to rustlings. This project contains small exercises to get you used

The Learning&Training Hub of OS Kernel 2 Oct 31, 2023
DevNot Summit 2023 etkinliğindeki Programcıdan Programcıya Rust konulu sunuma ait örnek kodları içerir.

DevNot Summit 2023 - Programcıdan Programcıya Rust DevNot Summit 2023 etkinliğindeki Programcıdan Programcıya Rust konulu sunuma ait örnek kodları içe

Burak Selim Senyurt 8 Oct 12, 2023
Repository containing schedules, slides/talk and user submissions for the 2023 devconnect hackerhouse

2023 DevConnect Hacker House Content Schedule Hackathon Tracks xChain dapps - Total Prize pool of USD 12k (5k, 4k, 3k) Fully on-chain dapps - Total Pr

Internet Computer Hackers Den 8 Nov 22, 2023
🎄Solutions for Advent of Code 2023

?? Advent of Code 2023 Solutions for Advent of Code in Rust. 2023 Results Day Part 1 Part 2 Day 1 ⭐ ⭐ Day 2 ⭐ ⭐ Day 3 ⭐ ⭐ Day 4 ⭐ ⭐ Day 5 ⭐ ⭐ Day 6 ⭐

Felix Spöttel 3 Dec 4, 2023
My solutions for the Advent of Code 2023.

?? Advent Of Code 2023 Hi! These are my Rust solutions for the Advent of Code 2023. Day Name Source Part 1 Part 2 Time 1 Time 2 1 Trebuchet?! 01.rs ⭐

Marcus Cemes 3 Dec 7, 2023
Solutions of Advent-of-Code 2023 in Rust

Advent of Code 2023 in Rust If you've never heard of Advent of Code, you're missing out. Check it out now at adventofcode.com! I mostly do AoC puzzles

Aurélien Geron 4 Dec 8, 2023
Solutions to Advent of Code 2023 in Rust 🎄

Advent of Code 2023 Solutions to Advent of Code 2023 in Rust ?? Day Part 1 Part 2 Thoughts 1 ⭐ ⭐ As with most early advent of code challenges, it's mo

Pedro Godinho 6 Dec 6, 2023
🎄🎅 My Advent of Code 2023 solutions 🎁⛄

???? My AOC 2023 solutions ??⛄ ?? Table of contents ?? Table of the days ?? Goals ⛄ Quickstart ?? Table of the days Day Part 1 Part 2 Language 01 Toki

rei 6 Dec 11, 2023
Solutions to Advent of Code 2023 in Rust! :crab:

AdventOfCode2023 ?? Solutions to AoC 2023 in Rust ?? Usage # to be able to download inputs (see fetch.sh) export AOC_SESSION=[value from session cooki

Axel Lindeberg 27 Dec 17, 2023
Advent of Code 2023 solutions - #15 on global leaderboard

My solutions for Advent of Code 2023, written in Rust. The code requires Rust nightly to run. Sample inputs from each day are provided. To run with ac

Daniel Huang 28 Dec 17, 2023
My Advent of Code 2023 solutions in the Rust programming language.

Advent of Code 2023 in Rust My Advent of Code 2023 solutions in the Rust programming language. This repository holds a separate Rust project for each

Tim Visée 65 Dec 17, 2023
Generic Differential Evolution for Rust

Differential Evolution Simple and powerful global optimization using a Self-Adapting Differential Evolution for Rust. See Wikipedia's article on Diffe

Martin Leitner-Ankerl 13 Apr 30, 2022