Fix typos
This commit is contained in:
parent
66b4ec306d
commit
28ac40923c
10 changed files with 16 additions and 15 deletions
1
changelogs/unreleased/1260-rex4539
Normal file
1
changelogs/unreleased/1260-rex4539
Normal file
|
@ -0,0 +1 @@
|
|||
Fix typos
|
|
@ -1,5 +1,5 @@
|
|||
// After all generics are inlined, a program should be completely "concrete", which means that all types must only contain
|
||||
// litterals for array sizes. This is especially important to generate the ABI of the program.
|
||||
// literals for array sizes. This is especially important to generate the ABI of the program.
|
||||
// It is direct to ensure that with most types, however the way structs are implemented requires a slightly different process:
|
||||
// Where for an array, `field[N]` ends up being propagated to `field[42]` which is direct to turn into a concrete type,
|
||||
// for structs, `Foo<N> { field[N] a }` is propagated to `Foo<42> { field[N] a }`. The missing step is replacing `N` by `42`
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# ZoKrates ABI
|
||||
|
||||
In order to interact programatically with compiled ZoKrates programs, ZoKrates supports passing arguments using an ABI.
|
||||
In order to interact programmatically with compiled ZoKrates programs, ZoKrates supports passing arguments using an ABI.
|
||||
|
||||
To illustrate this, we'll use the following example program:
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Performing a trusted setup using a multi-party computation protocol (MPC)
|
||||
|
||||
The zk-SNARK schemes supported by ZoKrates require a trusted setup. This procedure must be run to generate the proving and verification keys. This procedure generates some data often refered to as "toxic waste" which can be used to create fake proofs which will be accepted by the verifier. The entity running the trusted setup is trusted to delete this toxic waste.
|
||||
The zk-SNARK schemes supported by ZoKrates require a trusted setup. This procedure must be run to generate the proving and verification keys. This procedure generates some data often referred to as "toxic waste" which can be used to create fake proofs which will be accepted by the verifier. The entity running the trusted setup is trusted to delete this toxic waste.
|
||||
Using an MPC protocol, we can run the trusted setup in a decentralized way, so that this responsibility is shared among all participants of the setup. If at least one participant is honest and deletes their part of the toxic waste, then no fake proofs can be created by anyone.
|
||||
This section of the book describes the steps to perform a trusted setup for the Groth16 scheme.
|
||||
|
||||
|
@ -35,7 +35,7 @@ Parameters written to `mpc.params`
|
|||
```
|
||||
|
||||
Using the `-r` flag, we pass a path to the file which contains the parameters for our circuit with depth `2^n` (`phase1radix2m{n}`).
|
||||
The parameters for various circuit depths can be computed using the [phase2-bn254](https://github.com/kobigurk/phase2-bn254) utility
|
||||
The parameters for various circuit depths can be computed using the [phase2-bn254](https://github.com/kobigurk/phase2-bn254) utility
|
||||
by picking the latest response from the [Perpetual Powers of Tau](https://github.com/weijiekoh/perpetualpowersoftau) and following the instructions in the mentioned repositories.
|
||||
|
||||
## Making a contribution
|
||||
|
@ -126,9 +126,9 @@ Your contribution has been written to `final.params`
|
|||
```
|
||||
|
||||
The random beacon is the `2^n` iteration of `SHA256` over the hash evaluated on
|
||||
some high entropy and publicly available data. Possible sources of data could be:
|
||||
some high entropy and publicly available data. Possible sources of data could be:
|
||||
* The closing value of the stock market on a certain date
|
||||
* The output of a selected set of national lotteries
|
||||
* The output of a selected set of national lotteries
|
||||
* The value of a block at a particular height in one or more blockchains
|
||||
* [League of Entropy](https://www.cloudflare.com/leagueofentropy/) (drand)
|
||||
|
||||
|
@ -163,5 +163,5 @@ Once the ceremony is finalized, we can export the keys and use them to generate
|
|||
The secure generation of parameters for zk-SNARKs is a crucial step in the trustworthiness of the resulting proof system.
|
||||
The security of the ceremony relies entirely on the fact that at least one participant needs to securely delete their "toxic waste" for the resulting parameters to be generated honestly.
|
||||
Opening the ceremony to a large number of participants reduces the probability that the resulting parameters are dishonest.
|
||||
Once the ceremony is finalized, we can generate a verifier smart contract by using the keys we obtained through the trusted setup ceremony.
|
||||
Once the ceremony is finalized, we can generate a verifier smart contract by using the keys we obtained through the trusted setup ceremony.
|
||||
At this point, we can safely deploy the contract and verify proofs on-chain.
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
def main() {
|
||||
// `255` is infered to `255f`, and the addition happens between field elements
|
||||
// `255` is inferred to `255f`, and the addition happens between field elements
|
||||
assert(255 + 1f == 256);
|
||||
|
||||
// `255` is infered to `255u8`, and the addition happens between u8
|
||||
// `255` is inferred to `255u8`, and the addition happens between u8
|
||||
// This causes an overflow
|
||||
assert(255 + 1u8 == 0);
|
||||
|
||||
|
|
|
@ -259,7 +259,7 @@ impl<'ast, T: Field> Flattener<'ast, T> {
|
|||
/// As long as `sizeUnknown` is `true` we don't yet know if a is <= than b.
|
||||
/// 2. Loop over `b`:
|
||||
/// * b[0] = 1
|
||||
/// when `b` is 1 we check wether `a` is 0 in that particular run and update
|
||||
/// when `b` is 1 we check whether `a` is 0 in that particular run and update
|
||||
/// `sizeUnknown` accordingly:
|
||||
/// `sizeUnknown = sizeUnknown && a[0]`
|
||||
/// * b[1] = 1
|
||||
|
|
|
@ -988,7 +988,7 @@ impl<'ast, T: Field> Checker<'ast, T> {
|
|||
_ => unreachable!(),
|
||||
};
|
||||
|
||||
// return if any errors occured
|
||||
// return if any errors occurred
|
||||
if !errors.is_empty() {
|
||||
return Err(errors);
|
||||
}
|
||||
|
@ -1035,7 +1035,7 @@ impl<'ast, T: Field> Checker<'ast, T> {
|
|||
|
||||
// insert into typed_modules if we checked anything
|
||||
if let Some(typed_module) = to_insert {
|
||||
// there should be no checked module at that key just yet, if there is we have a colision or we checked something twice
|
||||
// there should be no checked module at that key just yet, if there is we have a collision or we checked something twice
|
||||
assert!(state
|
||||
.typed_modules
|
||||
.insert(module_id.to_path_buf(), typed_module)
|
||||
|
|
|
@ -27,7 +27,7 @@ def le<N>(field a, field c) -> bool {
|
|||
return le(a_bits, c_bits);
|
||||
}
|
||||
|
||||
// this instanciates comparison starting from u32
|
||||
// this instantiates comparison starting from u32
|
||||
def le(u32 a, u32 c) -> bool {
|
||||
bool[32] a_bits = u32_to_bits(a);
|
||||
bool[32] c_bits = u32_to_bits(c);
|
||||
|
|
|
@ -13,7 +13,7 @@ pub type ExecutionResult<T> = Result<Witness<T>, Error>;
|
|||
#[derive(Default)]
|
||||
pub struct Interpreter {
|
||||
/// Whether we should try to give out-of-range bit decompositions when the input is not a single summand.
|
||||
/// Used to do targetted testing of `<` flattening, making sure the bit decomposition we base the result on is unique.
|
||||
/// Used to do targeted testing of `<` flattening, making sure the bit decomposition we base the result on is unique.
|
||||
should_try_out_of_range: bool,
|
||||
}
|
||||
|
||||
|
|
|
@ -6,4 +6,4 @@ JavaScript bindings for [ZoKrates](https://github.com/Zokrates/ZoKrates) project
|
|||
npm install zokrates-js
|
||||
```
|
||||
|
||||
Check the offical [ZoKrates documentation](https://zokrates.github.io/toolbox/zokrates_js.html) for more details.
|
||||
Check the official [ZoKrates documentation](https://zokrates.github.io/toolbox/zokrates_js.html) for more details.
|
||||
|
|
Loading…
Reference in a new issue