1. 引言
前序博客有:
- Polygon zkEVM Arithmetic状态机
- Polygon zkEVM中的常量多项式
Binary状态机为Polygon zkEVM的六个二级状态机之一,该状态机内包含:
- executor part:sm_binary.js:负责生成execution trace,为常量多项式和隐私多项式赋值。
- 验证规则集PIL:binary.pil:定义了约束系统。
相应的test vectors见:binary_test.js:包含了所支持的各类计算的测试集。
Polygon zkEVM Binary状态机针对的是256-bit字符串的二进制运算,当前支持的二进制运算有:
Table 1: All Operations Checked by the Binary SM
| Operation Name \textbf{Operation Name} Operation Name | Mnemonic \textbf{Mnemonic} Mnemonic | Symbol \textbf{Symbol} Symbol | BinOpCode \textbf{BinOpCode} BinOpCode |
|---|---|---|---|
| Addition \text{Addition} Addition | A D D \mathrm{ADD} ADD | + + + | 0 0 0 |
| Subtraction \text{Subtraction} Subtraction | S U B \mathrm{SUB} SUB | − - − | 1 1 1 |
| Less Than \text{Less Than} Less Than | L T \mathrm{LT} LT |
<
<
关注
打赏
立即登录/注册
微信扫码登录 |
