reset git index
This commit is contained in:
parent
77db01cafa
commit
6fe0944af8
|
@ -0,0 +1,126 @@
|
|||
A one-page pseudo-code to help understand how C-KZG-4844 performs a proof verification.
|
||||
|
||||
|
||||
BLST lib
|
||||
https://github.com/ethereum/c-kzg-4844/blob/main/bindings/go/blst_headers/blst.h#L57
|
||||
typedef uint64_t limb_t;
|
||||
typedef struct { byte b[256/8]; } blst_scalar;
|
||||
typedef struct { limb_t l[256/8/sizeof(limb_t)]; } blst_fr; //-- should be 4*4 bytes
|
||||
typedef struct { limb_t l[384/8/sizeof(limb_t)]; } blst_fp;
|
||||
|
||||
typedef byte pow256[256/8];
|
||||
blst_scalar_from_bendian
|
||||
(complex code; https://github.com/supranational/blst/blob/master/src/exports.c#L421C16-L421C16)
|
||||
blst_fr_from_scalar
|
||||
(complex code; https://github.com/supranational/blst/blob/master/src/exports.c#L72)
|
||||
|
||||
C-KZG-4844 lib
|
||||
typedef blst_fr fr_t; /**< Internal Fr field element type. */
|
||||
|
||||
typedef struct {
|
||||
uint8_t bytes[BYTES_PER_BLOB];
|
||||
} Blob;
|
||||
|
||||
typedef struct {
|
||||
fr_t evals[FIELD_ELEMENTS_PER_BLOB];
|
||||
} Polynomial;
|
||||
|
||||
#define FIELD_ELEMENTS_PER_BLOB 4096 // OVERRIDABLE
|
||||
|
||||
/** The number of bytes in a KZG commitment. */
|
||||
#define BYTES_PER_COMMITMENT 48
|
||||
|
||||
/** The number of bytes in a KZG proof. */
|
||||
#define BYTES_PER_PROOF 48
|
||||
|
||||
/** The number of bytes in a BLS scalar field element. */
|
||||
#define BYTES_PER_FIELD_ELEMENT 32
|
||||
|
||||
/** The number of bytes in a blob. */
|
||||
#define BYTES_PER_BLOB (FIELD_ELEMENTS_PER_BLOB * BYTES_PER_FIELD_ELEMENT)
|
||||
|
||||
/** The G1 generator. */
|
||||
static const g1_t G1_GENERATOR = { {0x5cb38790fd530c16L, 0x7817fc679976fff5L, 0x154f95c7143ba1c1L, 0xf0ae6acdf3d0e747L, 0xedce6ecc21dbf440L, 0x120177419e0bfb75L},{0xbaac93d50ce72271L, 0x8c22631a7918fd8eL, 0xdd595f13570725ceL,0x51ac582950405194L, 0x0e1c8c3fad0059c0L, 0x0bbc3efc5008a26aL},{0x760900000002fffdL, 0xebf4000bc40c0002L, 0x5f48985753c758baL,0x77ce585370525745L, 0x5c071a97a256ec6dL, 0x15f65ec3fa80e493L}};
|
||||
|
||||
/** The G2 generator. */
|
||||
static const g2_t G2_GENERATOR = {{{{0xf5f28fa202940a10L, 0xb3f5fb2687b4961aL, 0xa1a893b53e2ae580L,0x9894999d1a3caee9L, 0x6f67b7631863366bL, 0x058191924350bcd7L},{0xa5a9c0759e23f606L, 0xaaa0c59dbccd60c3L, 0x3bb17e18e2867806L,0x1b1ab6cc8541b367L, 0xc2b6ed0ef2158547L, 0x11922a097360edf3L}}},{{{0x4c730af860494c4aL, 0x597cfa1f5e369c5aL, 0xe7e6856caa0a635aL,0xbbefb5e96e0d495fL, 0x07d3a975f0ef25a2L, 0x0083fd8e7e80dae5L},{0xadc0fc92df64b05dL, 0x18aa270a2b1461dcL, 0x86adac6a3be4eba0L,0x79495c4ec93da33aL, 0xe7175850a43ccaedL, 0x0b2bc2a163de1bf2L}}},{{{0x760900000002fffdL, 0xebf4000bc40c0002L, 0x5f48985753c758baL,0x77ce585370525745L, 0x5c071a97a256ec6dL, 0x15f65ec3fa80e493L},{0x0000000000000000L, 0x0000000000000000L, 0x0000000000000000L,0x0000000000000000L, 0x0000000000000000L, 0x0000000000000000L}}}};
|
||||
|
||||
// Given a blob and its proof, verify that it corresponds to the provided commitment.
|
||||
VERIFY_BLOB_KZG_PROOF(blob, commitment_bytes, proof_bytes, settings)
|
||||
|
||||
commitment_g1 = bytes_to_kzg_commitment(commitment_bytes); // Convert untrusted bytes into a trusted and validated KZGCommitment.
|
||||
validate_kzg_g1(commitment_bytes) // Perform BLS validation required by the types KZGProof and KZGCommitment.
|
||||
/* Convert the bytes to a p1 point */
|
||||
/* The uncompress routine checks that the point is on the curve */
|
||||
p1_affine = blst_p1_uncompress(commitment_bytes)
|
||||
return blst_p1_from_affine(p1_affine)
|
||||
|
||||
proof_g1 = bytes_to_kzg_proof(proof_bytes)
|
||||
validate_kzg_g1(proof_bytes)
|
||||
(same as above)
|
||||
|
||||
polynomial = blob_to_polynomial(blob) // Deserialize a Blob (array of bytes) into a Polynomial (array of field elements).
|
||||
for 0..FIELD_ELEMENTS_PER_BLOB
|
||||
bytes_to_bls_field // Convert untrusted bytes to a trusted and validated BLS scalar field element.
|
||||
blst_scalar_from_bendian --> blst_scalar
|
||||
blst_fr_from_scalar
|
||||
|
||||
challenge = byte[32] = compute_challenge(blob, commitment_g1) // Return the Fiat-Shamir challenge required to verify `blob` and `commitment`
|
||||
tmp_buffer
|
||||
// add stuff to buffer
|
||||
bytes_from_g1(commitment_g1) // Copy commitment; Serialize a G1 group element into bytes.
|
||||
tmp_buffer += blst_p1_compress(commitment_g1)
|
||||
tmp2 = blst_sha256(tmp_buffer) // Single-shot SHA-256 hash function.
|
||||
return hash_to_bls_field(tmp2) // Map bytes to a BLS field element.
|
||||
blst_scalar_from_bendian
|
||||
blst_fr_from_scalar
|
||||
|
||||
// Evaluate challenge to get y. //-- challenge == x? or possibly z?
|
||||
fr_t y_fr = evaluate_polynomial_in_evaluation_form(polynomial, challenge, settings) // Evaluate a polynomial in evaluation form at a given point.
|
||||
fr_t inverses_in[FIELD_ELEMENTS_PER_BLOB], inverses[FIELD_ELEMENTS_PER_BLOB]
|
||||
for 0..FIELD_ELEMENTS_PER_BLOB
|
||||
blst_fr_sub(&inverses_in[i], x, settings->roots_of_unity[i])
|
||||
fr_batch_inv(inverses, inverses_in, FIELD_ELEMENTS_PER_BLOB) // Montgomery batch inversion in finite field.
|
||||
|
||||
// Call helper to do pairings check
|
||||
// Verify KZG proof claiming that `p(z) == y`
|
||||
// Given a @p commitment to a polynomial, a @p proof for @p z, and the claimed value @p y at @p z, verify the claim.
|
||||
// @param[in] commitment The commitment to a polynomial
|
||||
// @param[in] z The point at which the proof is to be checked (opened)
|
||||
// @param[in] y The claimed value of the polynomial at @p z
|
||||
// @param[in] proof A proof of the value of the polynomial at the point @p z
|
||||
// @param[in] s The trusted setup
|
||||
return verify_kzg_proof_impl(commitment_g1, z=challenge, y_fr, proof_g1, settings)
|
||||
|
||||
// Calculate: X_minus_z
|
||||
x_g2 = g2_mul(G2_GENERATOR, z) // Multiply a G2 group element by a field element.
|
||||
scalar = blst_scalar_from_fr(z)
|
||||
// The last argument is the number of bits in the scalar
|
||||
return blst_p2_mult(G2_GENERATOR, scalar.b, 8 * sizeof(blst_scalar)) // sizeof=32
|
||||
|
||||
// Subtraction of G2 group elements.
|
||||
// a A G2 group element
|
||||
// b The G2 group element to be subtracted
|
||||
X_minus_z = g2_sub(a=settings->g2_values[1], x_g2)
|
||||
bneg = x_g2
|
||||
blst_p2_cneg(&bneg, cbit: true)
|
||||
return blst_p2_add_or_double(a, bneg)
|
||||
|
||||
// Calculate: P_minus_y
|
||||
// a The G1 group element
|
||||
// b The multiplier
|
||||
y_g1 = g1_mul(a=G1_GENERATOR, b=y_fr)
|
||||
scalar = blst_scalar_from_fr(b)
|
||||
// The last argument is the number of bits in the scalar
|
||||
return blst_p1_mult(a, scalar.b, 8 * sizeof(blst_scalar)) // = 8*32
|
||||
|
||||
// Subtraction of G1 group elements.
|
||||
// a A G1 group element
|
||||
// b The G1 group element to be subtracted
|
||||
P_minus_y = g1_sub(a=commitment_g1, b=y_g1);
|
||||
g1_t bneg = b
|
||||
blst_p1_cneg(&bneg, true);
|
||||
return blst_p1_add_or_double(a, bneg);
|
||||
|
||||
/* Verify: P - y = Q * (X - z) */
|
||||
pairings_verify(P_minus_y, G2_GENERATOR, proof, X_minus_z);
|
|
@ -0,0 +1,2 @@
|
|||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
|
@ -0,0 +1,4 @@
|
|||
nimcache/
|
||||
nimblecache/
|
||||
htmldocs/
|
||||
bin/*
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Debug Nim Project",
|
||||
"type": "gdb",
|
||||
"request": "launch",
|
||||
"target": "./bin/main",
|
||||
"cwd": "${workspaceRoot}",
|
||||
"valuesFormatting": "parseText"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||
// for the documentation about the tasks.json format
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "Build Nim Project",
|
||||
"type": "shell",
|
||||
"command": "nim --out:bin/main -d:debug --debugger:native c -r main testOnSave",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,201 @@
|
|||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright 2018 Status Research & Development GmbH
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
|
@ -0,0 +1,21 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2018 Status Research & Development GmbH
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -0,0 +1,33 @@
|
|||
# Nimbus Verkle Tree implementation (WIP)
|
||||
[![License: Apache](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
|
||||
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
|
||||
|
||||
[![Discord: Nimbus](https://img.shields.io/badge/discord-nimbus-orange.svg)](https://discord.gg/XRxWahP)
|
||||
[![Status: #nimbus-general](https://img.shields.io/badge/status-nimbus--general-orange.svg)](https://get.status.im/chat/public/nimbus-general)
|
||||
|
||||
This repo will contain an implementation of [Verkle trees](https://dankradfeist.de/ethereum/2021/06/18/verkle-trie-for-eth1.html),
|
||||
in the Nim programming language, to be integrated into the [Nimbus project](https://github.com/status-im/nimbus-eth1) when the implementation matures.
|
||||
|
||||
# TODO
|
||||
|
||||
## KZG polynomial commitments
|
||||
|
||||
- [ ] Evaluate if the [c-kzg-4844 library](https://github.com/ethereum/c-kzg-4844) can be used or extended to support computing KZG commitments with the parameters needed for Verkle trees (32 bytes keys and values, 256 items per commitment).
|
||||
- [ ] If not, implement the logic by making use of [IPA Multipoint](https://github.com/crate-crypto/ipa_multipoint) / [Banderwagon](https://github.com/crate-crypto/banderwagon) / [blst](https://github.com/supranational/blst)
|
||||
- [ ] Create tests focusing on the integration between the high-level Nim code and libraries, e.g. big/little endian issues
|
||||
|
||||
|
||||
## Verkle tree implementation
|
||||
|
||||
- [ ] Implement the Verkle tree structure, with basic operations (e.g. adding nodes)
|
||||
- [ ] Support computation of commitments / proofs. Possibly, cache them in the tree.
|
||||
- [ ] Support tree mutation with minimal recomputation of commitments
|
||||
- [ ] Create tests, focusing on edge cases (empty tree, sparse tree, dense tree, consistency after mutations). Possibly use fuzzing with deterministic random, as done in [rust-verkle](https://github.com/crate-crypto/rust-verkle/blob/master/verkle-trie/tests/trie_fuzzer.rs).
|
||||
- [ ] Create comparative tests between the various Verkle implementations; given an identical tree, identical commitments are expected
|
||||
|
||||
|
||||
## Performance
|
||||
|
||||
- [ ] Analyze how Nimbus accesses the Merkle tree
|
||||
- [ ] Optimize the most common access patterns in the equivalent Verkle tree
|
||||
- [ ] Evaluate whether parallelism can be leveraged
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue