You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -18,10 +19,12 @@ The signature scheme can be instantiated in two version:
18
19
* Falcon, the standard signature scheme, fully compliant with the algorithm recommended by the NIST,
19
20
* An EVM-friendly version where the hash function is efficiently computed in the Ethereum Virtual Machine.
20
21
21
-
Three OPCODES are specified:
22
-
-`HASH_TO_POINT`, that implements the NIST-compliant HashToPoint as described in [Algorithm 3](https://falcon-sign.info/falcon.pdf) of Falcon.
23
-
-`ETH_HASH_TO_POINT`, a EVM-friendly version of HashToPoint.
24
-
-`FALCON_CORE`: the core algorithm of Falcon, that verifies the signature from the obtained (HashToPoint) challenge.
22
+
Three precompiled contracts are specified (formerly called `ETH_HASH_TO_POINT` / `HASH_TO_POINT_ETH` in drafts):
23
+
24
+
*`FALCON_HASH_TO_POINT_SHAKE256` — that implements the NIST-compliant HashToPoint as described in [Algorithm 3](https://falcon-sign.info/falcon.pdf) of Falcon.
25
+
*`FALCON_HASH_TO_POINT_KECCAKPRNG` — EVM-friendly Hash-to-Point using a Keccak-based XOF/PRNG.
26
+
*`FALCON_CORE` — the core algorithm of Falcon, that verifies the signature from the obtained (HashToPoint) challenge.
27
+
25
28
26
29
## 2. Motivation
27
30
@@ -43,11 +46,11 @@ For FalconRec,
43
46
TOTAL=1324
44
47
-->
45
48
46
-
In the context of the Ethereum Virtual Machine, a precompile for Keccak256 hash function is already available, making Falcon verification much faster when instantiated with an extendable output function derived from Keccak than with SHAKE256, as specified in NIST submission. This EIP specifies a split of the signature verification into two sub procedures:
47
-
-`HASH_TO_POINT` or `ETH_HASH_TO_POINT`, instantiated with a different eXtendable Output Function: the first with SHAKE256 (as recommended by NIST), the second with Keccak-PRNG (a version that is more efficient when computed in the EVM). In the future, it is possible to define it for SNARK/STARK circuits. An appropriated hash function choice reduces drastically the circuit size and the proving time in the context of ZK applications.
49
+
In the context of the Ethereum Virtual Machine, a precompile for Keccak256 hash function is already available, making Falcon verification much faster when instantiated with an extendable output function derived from Keccak than with SHAKE256, as specified in NIST submission. This EIP specifies a split of the signature verification into two sub procedures:
50
+
-`FALCON_HASH_TO_POINT_SHAKE256` or `FALCON_HASH_TO_POINT_KECCAKPRNG`, instantiated with a different eXtendable Output Function: the first with SHAKE256 (as recommended by NIST), the second with Keccak-PRNG (a version that is more efficient when computed in the EVM). In the future, it is possible to define it for SNARK/STARK circuits. An appropriated hash function choice reduces drastically the circuit size and the proving time in the context of ZK applications.
48
51
-`FALCON_CORE`, that does not require any hash computation. This sub-algorithm follows the NIST recommendation so that:
49
-
- using the SHAKE256 `HASH_TO_POINT`, the signature is fully compliant with the NIST standard,
50
-
- using the KeccakPRNG `ETH_HASH_TO_POINT`, the verification can be efficient even in the EVM.
52
+
- using the SHAKE256 `FALCON_HASH_TO_POINT_SHAKE256`, the signature is fully compliant with the NIST standard,
53
+
- using the KeccakPRNG `FALCON_HASH_TO_POINT_KECCAKPRNG`, the verification can be efficient even in the EVM.
51
54
52
55
Using this separation, two important features are provided: one version being fully compliant with the NIST specification, the other deviating from the standard in order to reduce the gas cost, and opening up to possible computations of Falcon signature ZK proofs.
The functions `falcon512_verify` and `ethfalcon512_verify` call the opcodes specified in the next sections: `HASH_TO_POINT`, `ETH_HASH_TO_POINT` and `FALCON_CORE`.
120
+
The functions `falcon512_verify` and `ethfalcon512_verify` call the precompiles specified in the next sections: `FALCON_HASH_TO_POINT_SHAKE256`, `FALCON_HASH_TO_POINT_KECCAKPRNG` and `FALCON_CORE`.
118
121
119
122
120
-
### 3.1. Hash To Point Challenge
123
+
### 3.1. Hash-to-Point challenge (normative)
121
124
122
125
1.**Parse Input Data:** Check the byte sizes and then extract the message and the signature. The parsed signature is a tuple of values $(r, s_2)$. $r$ is denoted as the salt and contains bytes, and $s_2$ is denoted as the signature vector, a vector of elements mod $q$.
123
-
2.**Verify Well-formedness:** Verify that the signature contains 40 bytes of salt for $r$.
126
+
2.**Verify Well-formedness:** Verify that the signature contains a 40-byte salt $r$.
124
127
<!-- See the `Required Checks in Verification` section for more details. -->
125
128
3.**Compute the challenge $c$:** the challenge is obtained from hash-to-point on the salt $r$ of the signature and the message. The output $c$ is a polynomial of degree 512, stored in 896 bytes.
126
129
The hash-to-point function computes eXtendable Output from a hash Function (XOF). This EIP provides two instantiations of a XOF:
@@ -167,9 +170,9 @@ The hash-to-point function computes eXtendable Output from a hash Function (XOF)
167
170
```
168
171
Precompile of `Keccak256` are available in the Ethereum Virtual Machine, making this XOF very efficient in the EVM.
169
172
170
-
Using one of the XOFs above (SHAKE256 or Keccak-PRNG), it is possible to instantiate two (opcode) algorithms for hashing into points:
173
+
Using one of the XOFs above (SHAKE256 or Keccak-PRNG), it is possible to instantiate two (precompiles) algorithms for hashing into points:
#### Encoding of the challenge polynomial `c` (897 bytes, normative)
247
+
* Domain: degree-512 polynomial with coefficients in `[0, q)`, `q = 12289`.
248
+
* Order: coefficients are serialized in index order `c[0], c[1], …, c[511]`.
249
+
* Bit-packing: each coefficient is a 14-bit **big-endian** unsigned integer. Concatenate all 512 encodings into a bitstring, then left-pad the final byte with zero bits to reach exactly **897 bytes**. Consumers MUST reject encodings that are not exactly 897 bytes.
250
+
243
251
### 3.2 Core algorithm
244
252
245
253
1.**Parse Input Data:** Check the byte sizes and then extract the public key, the Hash To Point Challenge and the signature.
@@ -329,66 +337,20 @@ if one of the above condition is not met then all the gas supplied along with a
329
337
it shall also be burned if an error happens during decompression (incorrect encodings).
330
338
331
339
332
-
### 3.4. Compliance with EIP-7932
333
-
334
-
In compliance with EIP-7932, the necessary parameters and structure for its integration are provided. `ALG_TYPE = 0xFA` uniquely identifies Falcon-512 transactions, set MAX_SIZE = 699 bytes to accommodate the fixed-length signature_info container (comprising a 1-byte version tag, a 666-byte Falcon signature, and a 32-byte public key hash), and recommend a `GAS_PENALTY` of approximately `3000` gas subject to benchmarking. The verification function follows the EIP-7932 model, parsing the signature_info, recovering the corresponding Falcon public key, verifying the signature against the transaction payload hash, and deriving the signer’s Ethereum address as the last 20 bytes of keccak256(pubkey). This definition ensures that Falcon-512 can be cleanly adopted within the `AlgorithmicTransaction` container specified by EIP-7932.
335
-
336
-
```python
337
-
signature_info = Container[
338
-
# 0xFA for Falcon-512 NIST-compliant,
339
-
# 0xFB for Falcon-512 for the EVM-friendly version,
* 897 bytes: packed challenge polynomial `c` (see §3.1 encoding)
386
349
387
-
#### Error Cases
388
-
- Invalid input length (not compliant to described input)
350
+
###4.2. `FALCON_HASH_TO_POINT_KECCAKPRNG`
351
+
Same I/O as §4.1, but the XOF is Keccak-PRNG. The construction is normative and MUST define: state initialization, domain-separation (if any), counter width and endianness, and block concatenation order.
389
352
390
-
### 4.2. Falcon Core precompiled contract
391
-
The precompiled contract FALCON_COREis proposed with the following inputand outputs, which are big-endian values:
353
+
### 4.3. `FALCON_CORE`
392
354
393
355
-**Input data**
394
356
- 666 bytes for Falcon-512 compressed signature
@@ -404,9 +366,9 @@ The precompiled contract FALCON_CORE is proposed with the following input and ou
404
366
- Invalid norm bound
405
367
- Signature verification failure
406
368
407
-
### 4.3. Precompiled Contract Gas Usage
369
+
### 4.4. Precompiled Contract Gas Usage
408
370
409
-
The cost of the **HASH_TO_POINT**and**HASH_TO_POINT_ETH**isset to 1000 gas.
371
+
The cost of the **FALCON_HASH_TO_POINT_SHAKE256** and **FALCON_HASH_TO_POINT_KECCAKPRNG** is set to 1000 gas.
410
372
411
373
The cost of **FALCON_CORE** is set to 2000 gas.
412
374
@@ -438,7 +400,50 @@ The cost is interpolated using rule of thumb from SUPERCOPS signatures benchmark
438
400
439
401
## 6. Backwards Compatibility
440
402
441
-
No backward compatibility issues found.
403
+
In compliance with EIP-7932, the necessary parameters and structure for its integration are provided. `ALG_TYPE = 0xFA` uniquely identifies Falcon-512 transactions, set MAX_SIZE = 667 bytes to accommodate the fixed-length signature_info container (comprising a 1-byte version tag and a 666-byte Falcon signature), and recommend a `GAS_PENALTY` of approximately `3000` gas subject to benchmarking. The verification function follows the EIP-7932 model, parsing the signature_info, recovering the corresponding Falcon public key, verifying the signature against the transaction payload hash, and deriving the signer's Ethereum address as the last 20 bytes of keccak256(pubkey). This definition ensures that Falcon-512 can be cleanly adopted within the `AlgorithmicTransaction` container specified by EIP-7932.
404
+
405
+
As per EIP-7932, this EIP defines two Falcon algorithm types:
406
+
*`ALG_TYPE = 0xFA` — Falcon-512 with SHAKE256 H2P
407
+
*`ALG_TYPE = 0xFB` — Falcon-512 with Keccak-PRNG H2P
408
+
409
+
**Container and sizes.** The `signature_info` container omits any pubkey hash; the public key is recovered by `verify(...)` and the 7932 sig-recover precompile derives the address as `keccak(ALG_TYPE || pubkey)[12:]`. Therefore:
**TBD by ACD.** Final precompile addresses will be selected within the EIP-managed range of EIP-1352, explicitly **avoiding `0x0100–0x01FF` reserved for RIPs** by EIP-7587.
442
447
443
448
## 7. Test Cases
444
449
@@ -453,7 +458,7 @@ An implementation is provided in `assets` (TODO). For the NIST-compliant version
453
458
454
459
## 9. Security Considerations
455
460
456
-
The derivation path to obtain the private key from the seed is (tbd).
461
+
The derivation path to obtain the private key from the seed is (tbd). Hash-to-Point functions MUST follow the specified XOFs byte-for-byte; domain separation and padding are normative.
457
462
458
463
## 10. Copyright
459
464
Copyright and related rights waived via [CC0](../LICENSE.md).
0 commit comments