Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

halo2-code-camp/exercises-ideas #28

Open
Demian101 opened this issue Oct 25, 2023 · 2 comments
Open

halo2-code-camp/exercises-ideas #28

Demian101 opened this issue Oct 25, 2023 · 2 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@Demian101
Copy link
Member

https://mp.weixin.qq.com/s/s32FxozSDH_BOWHsEO3olQ

  • @玛卡巴卡 : 类似于这种小 demo,用单元测试检测就好了
  • 最重要的还是 lab 的设计,然后挖空项目留给学员就可以嘞,类似于国外大学那种计算机课,lab1,lab2,lab3 这种最后形成一个大的作品的

@kurtpan666 : 20年复旦本科生密码学课的5个lab都是我设计的。我设计lab的思路就是: 1. ctf 形式,学生可以verifiably的知道自己做对了,比如实现了DES解密预定的文本,执行共模攻击破解一段RSA加密文本等 。2. 把scaffold code 给到位,实验说明文档写清楚。最后学生普遍反馈不错。


@qizhou 这个很好。我跟 @po 商量了一下,我们计划把zkVM(尤其我们在合作的zkWasm)的一些子电路分拆出来,给大家做exercise
也是 @frank Jz Liu 这里面 https://palm-isthmus-1e4.notion.site/Halo2-As-A-Compiler-Series-21f07032ca35450fad310de9aa1feee6 第4部分的细化

我现在想到的就有:
1,如何做uint64的整数电路
2,在uint64的整数检查的基础上,怎么做uint64乘法(可以overflow)电路
3,在uint64的整数检查的基础上,怎么做uint64除法电路
4,最简单的内存read/write电路设计

(其实很多uint64的运算指令都是很好的电路设计问题)

@readygo67 : @Qi Zhou 我不知道我的理解是否正确,如果是我的话,会把uint 64转换成fp,然后再进行运算,最后的运算结果,如果不考虑溢出的话,就取低64位就好了

@qizhou 需要设计成为约束系统,比如如何取低64位(e.g., a + k * 2^64 where a in [0, 2^64) )
除法稍微麻烦一点
我的wild idea:如果这期Halo2大家觉得不错,我觉得下一期可以扩展exercise,做一期zkVM😄

@readygo67 : 除法用Fp的invert 是不是就可以了,对于a/b如果能整除,比如6/2应该是没问题,对于不能整除的情况比如6/4可能不太合适,如果a<b,商直接就是0了。 —— 需要支持不整除的情况的

@frank : 问题不是在Fp上计算啊,还是要用电路实现乘法器和除法器

@readygo67 : 把计算结果写在cell当中,然后去验证,就相当于使用电路了 (halo2中电路特性感觉没有像circom强)

@frank: (写在cell..) 这只是你填witness的过程。需要用constraint_system.create_gate 来自定义约束

@Demian101 Demian101 changed the title halo2-code-camp-ideas halo2-code-camp/exercises-ideas Oct 25, 2023
@Demian101
Copy link
Member Author

Actions 持续集成:

@Cincelia: 确实是这样的,以前我们 lab 要求学生 ssh 上 CS 系的 linux server,然后我跑脚本改作业
共学github可以设个CD/CI 学员发PR自动跑测试

@xing sir:
嗯。 那个功能很强大。
其实,如果共学的任务可以拆分并且可以验证。
完全可以 github actions 来做的。
关键是第一步比较难做。

@Demian101 Demian101 added documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Oct 25, 2023
@Demian101
Copy link
Member Author

https://github.com/zkp-co-learning/halo2-step-by-step/blob/main/halo2-tutorials/README.md

inspired by Rustlings, 根据 @po 和 0xPARC 的课程代码抽象了一个 halo2 代码 fill-in-blank 练习
大家可以把玩一下,可直接 Issue 提建议 ~

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant