Not only did we already have multiple booleans in it, yet it theoretically
could expand in the future. Not only is this more explicit, it actually cleans
some existing code.
commit e0a9e8825d6c22c797fb84e26ed6ef10136ca9c2
Author: Luke Parker <lukeparker5132@gmail.com>
Date: Fri Jan 6 04:24:08 2023 -0500
Remove Scanner::address
It either needed to return an Option, panic on misconfiguration, or return a
distinct Scanner type based on burning bug immunity to offer this API properly.
Panicking wouldn't be proper, and the Option<Address> would've been... awkward.
The new register_subaddress function, maintaining the needed functionality,
also provides further clarity on the intended side effect of the previously
present Scanner::address function.
commit 7359360ab2fc8c9255c6f58250c214252ce217a4
Author: Luke Parker <lukeparker5132@gmail.com>
Date: Fri Jan 6 01:35:02 2023 -0500
fmt/clippy from last commit
commit 80d912fc19cd268f3b019a9d9961a48b2c45e828
Author: Luke Parker <lukeparker5132@gmail.com>
Date: Thu Jan 5 19:36:49 2023 -0500
Add Substrate "assets" pallet
While over-engineered for our purposes, it's still usable.
Also cleans the runtime a bit.
commit 2ed2944b6598d75bdc3c995aaf39b717846207de
Author: Luke Parker <lukeparker5132@gmail.com>
Date: Wed Jan 4 23:09:58 2023 -0500
Remove the timestamp pallet
It was needed for contracts, which has since been removed. We now no longer
need it.
commit 7fc1fc2dccecebe1d94cb7b4c00f2b5cb271c87b
Author: Luke Parker <lukeparker5132@gmail.com>
Date: Wed Jan 4 22:52:41 2023 -0500
Initial validator sets pallet (#187)
* Initial work on a Validator Sets pallet
* Update Validator Set docs per current discussions
* Update validator-sets primitives and storage handling
* Add validator set pallets to deny.toml
* Remove Curve from primitives
Since we aren't reusing keys across coins, there's no reason for it to be
on-chain (as previously planned).
* Update documentation on Validator Sets
* Use Twox64Concat instead of Identity
Ensures an even distribution of keys. While xxhash is breakable, these keys
aren't manipulatable by users.
* Add math ops on Amount and define a coin as 1e8
* Add validator-sets to the runtime and remove contracts
Also removes the randomness pallet which was only required by the contracts
runtime.
Does not remove the contracts folder yet so they can still be referred to while
validator-sets is under development. Does remove them from Cargo.toml.
* Add vote function to validator-sets
* Remove contracts folder
* Create an event for the Validator Sets pallet
* Remove old contracts crates from deny.toml
* Remove line from staking branch
* Remove staking from runtime
* Correct VS Config in runtime
* cargo update
* Resolve a few PR comments on terminology
* Create a serai-primitives crate
Move types such as Amount/Coin out of validator-sets. Will be expanded in the
future.
* Fixes for last commit
* Don't reserve set 0
* Further fixes
* Add files meant for last commit
* Remove Staking transfer
commit 3309295911d22177bd68972d138aea2f8658eb5f
Author: Luke Parker <lukeparker5132@gmail.com>
Date: Wed Jan 4 06:17:00 2023 -0500
Reorder coins in README by market cap
commit db5d19cad33ccf067d876b7f5b7cca47c228e2fc
Author: Luke Parker <lukeparker5132@gmail.com>
Date: Wed Jan 4 06:07:58 2023 -0500
Update README
commit 606484d744b1c6cc408382994c77f1def25d3e7d
Author: Luke Parker <lukeparker5132@gmail.com>
Date: Wed Jan 4 03:17:36 2023 -0500
cargo update
commit 3a319b229f
Author: akildemir <aeg_asd@hotmail.com>
Date: Wed Jan 4 16:26:25 2023 +0300
update address public API design
commit d9fa88fa76
Author: akildemir <aeg_asd@hotmail.com>
Date: Mon Jan 2 13:35:06 2023 +0300
fix clippy error
commit cc722e897b
Merge: cafa9b3eeca440
Author: akildemir <aeg_asd@hotmail.com>
Date: Mon Jan 2 11:39:04 2023 +0300
Merge https://github.com/serai-dex/serai into develop
commit cafa9b361e
Author: akildemir <aeg_asd@hotmail.com>
Date: Mon Jan 2 11:38:26 2023 +0300
fix build errors
commit ce5b5f2b37
Merge: f502d6749c4acf
Author: akildemir <aeg_asd@hotmail.com>
Date: Sun Jan 1 15:16:25 2023 +0300
Merge https://github.com/serai-dex/serai into develop
commit f502d67282
Author: akildemir <aeg_asd@hotmail.com>
Date: Thu Dec 22 13:13:09 2022 +0300
fix pr issues
commit 26ffb226d4
Author: akildemir <aeg_asd@hotmail.com>
Date: Thu Dec 22 13:11:43 2022 +0300
remove extraneous rpc call
commit 0e829f8531
Author: akildemir <aeg_asd@hotmail.com>
Date: Thu Dec 15 13:56:53 2022 +0300
add scan tests
commit 5123c7f121
Author: akildemir <aeg_asd@hotmail.com>
Date: Thu Dec 15 13:56:13 2022 +0300
add new address functions & comments
* Standardize the DLEq serialization function naming
They mismatched from the rest of the project.
This commit is technically incomplete as it doesn't update the dkg crate.
* Rewrite DKG encryption to enable per-message decryption without side effects
This isn't technically true as I already know a break in this which I'll
correct for shortly.
Does update documentation to explain the new scheme. Required for blame.
* Add a verifiable system for blame during the FROST DKG
Previously, if sent an invalid key share, the participant would realize that
and could accuse the sender. Without further evidence, either the accuser
or the accused could be guilty. Now, the accuser has a proof the accused is
in the wrong.
Reworks KeyMachine to return BlameMachine. This explicitly acknowledges how
locally complete keys still need group acknowledgement before the protocol
can be complete and provides a way for others to verify blame, even after a
locally successful run.
If any blame is cast, the protocol is no longer considered complete-able
(instead aborting). Further accusations of blame can still be handled however.
Updates documentation on network behavior.
Also starts to remove "OnDrop". We now use Zeroizing for anything which should
be zeroized on drop. This is a lot more piece-meal and reduces clones.
* Tweak Zeroizing and Debug impls
Expands Zeroizing to be more comprehensive.
Also updates Zeroizing<CachedPreprocess([u8; 32])> to
CachedPreprocess(Zeroizing<[u8; 32]>) so zeroizing is the first thing done
and last step before exposing the copy-able [u8; 32].
Removes private keys from Debug.
* Fix a bug where adversaries could claim to be using another user's encryption keys to learn their messages
Mentioned a few commits ago, now fixed.
This wouldn't have affected Serai, which aborts on failure, nor any DKG
currently supported. It's just about ensuring the DKG encryption is robust and
proper.
* Finish moving dleq from ser/deser to write/read
* Add tests for dkg blame
* Add a FROST test for invalid signature shares
* Batch verify encrypted messages' ephemeral keys' PoP
While the previous construction achieved n/2 average detection,
this will run in log2(n). Unfortunately, the need to keep entropy
around (or take in an RNG here) remains.
Technically, non-0-amount outputs can still appear and this considered them
as part of the global 0-amount pool. Now, only outputs which are 0-amount are
counted.
* Remove the explicit included participants from FROST
Now, whoever submits preprocesses becomes the signing set. Better separates
preprocess from sign, at the cost of slightly more annoying integrations
(Monero needs to now independently lagrange/offset its key images).
* Support caching preprocesses
Closes https://github.com/serai-dex/serai/issues/40.
I *could* have added a serialization trait to Algorithm and written a ton of
data to disk, while requiring Algorithm implementors also accept such work.
Instead, I moved preprocess to a seeded RNG (Chacha20) which should be as
secure as the regular RNG. Rebuilding from cache simply loads the previously
used Chacha seed, making the Algorithm oblivious to the fact it's being
rebuilt from a cache. This removes any requirements for it to be modified
while guaranteeing equivalency.
This builds on the last commit which delayed determining the signing set till
post-preprocess acquisition. Unfortunately, that commit did force preprocess
from ThresholdView to ThresholdKeys which had visible effects on Monero.
Serai will actually need delayed set determination for #163, and overall,
it remains better, hence it's inclusion.
* Document FROST preprocess caching
* Update ethereum to new FROST
* Fix bug in Monero offset calculation and update processor
A type alias of MoneroAddress is provided to abstract away the generic.
To keep the rest of the library sane, MoneroAddress is used everywhere.
If someone wants to use this library with another coin, they *should* be
able to parse a custom address and then recreate it as a Monero address.
While that's annoying to them, better them than any person using this
lib for Monero.
Closes#152.
* Add dkg crate
* Remove F_len and G_len
They're generally no longer used.
* Replace hash_to_vec with a provided method around associated type H: Digest
Part of trying to minimize this trait so it can be moved elsewhere. Vec,
which isn't std, may have been a blocker.
* Encrypt secret shares within the FROST library
Reduces requirements on callers in order to be correct.
* Update usage of Zeroize within FROST
* Inline functions in key_gen
There was no reason to have them separated as they were. sign probably
has the same statement available, yet that isn't the focus right now.
* Add a ciphersuite package which provides hash_to_F
* Set the Ciphersuite version to something valid
* Have ed448 export Scalar/FieldElement/Point at the top level
* Move FROST over to Ciphersuite
* Correct usage of ff in ciphersuite
* Correct documentation handling
* Move Schnorr signatures to their own crate
* Remove unused feature from schnorr
* Fix Schnorr tests
* Split DKG into a separate crate
* Add serialize to Commitments and SecretShare
Helper for buf = vec![]; .write(buf).unwrap(); buf
* Move FROST over to the new dkg crate
* Update Monero lib to latest FROST
* Correct ethereum's usage of features
* Add serialize to GeneratorProof
* Add serialize helper function to FROST
* Rename AddendumSerialize to WriteAddendum
* Update processor
* Slight fix to processor
* Create message types for FROST key gen
Taking in reader borrows absolutely wasn't feasible. Now, proper types
which can be read (and then passed directly, without a mutable borrow)
exist for key_gen. sign coming next.
* Move FROST signing to messages, not Readers/Writers/Vec<u8>
Also takes the nonce handling code and makes a dedicated file for it,
aiming to resolve complex types and make the code more legible by
replacing its previously inlined state.
* clippy
* Update FROST tests
* read_signature_share
* Update the Monero library to the new FROST packages
* Update processor to latest FROST
* Tweaks to terminology and documentation
Unbeknowst to me, height doesn't have a universal definition of the
chain length.
Bitcoin defines height as the block number, with getblockcount existing
for the chain length.
Ethereum uses the unambiguous term "block number".
Monero defines height as both the block number and the chain length.
Instead of arguing about who's right, it's agreed it referring to both
isn't productive. While we could provide our own definition, taking a
side, moving to the unambiguous block number prevents future hiccups.
height is now only a term in the Monero code, where it takes its
Monero-specific definition, as documented in the processor.
* Label the version as an alpha
* Add versions to Cargo.tomls
* Update to Zeroize 1.5
* Drop patch versions from monero-serai Cargo.toml
* Add a repository field
* Move generators to OUT_DIR
IIRC, I didn't do this originally as it constantly re-generated them.
Unfortunately, since cargo is complaining about .generators, we have to.
* Remove Timelock::fee_weight
Transaction::fee_weight's has a comment, "Assumes Timelock::None since
this library won't let you create a TX with a timelock". Accordingly,
this is dead code.