serai/coins/monero
Boog900 995734c960
Monero: add more legacy verify functions (#383)
* Add v1 ring sig verifying

* allow calculating signature hash for v1 txs

* add unreduced scalar type with recovery

I have added this type for borromen sigs, the ee field can be a normal
scalar as in the verify function the ee
field is checked against a reduced scalar mean for it to verify as
correct ee must be reduced

* change block major/ minor versions to u8

this matches Monero

I have also changed a couple varint functions to accept the `VarInt`
trait

* expose `serialize_hashable` on `Block`

* add back MLSAG verifying functions

I still need to revert the commit removing support for >1 input MLSAG FULL

This adds a new rct type to separate Full and simple rct

* add back support for multiple inputs for RCT FULL

* comment `non_adjacent_form` function

also added `#[allow(clippy::needless_range_loop)]` around a loop as without a re-write satisfying clippy without it will make the function worse.

* Improve Mlsag verifying API

* fix rebase errors

* revert the changes on `reserialize_chain`
plus other misc changes

* fix no-std

* Reduce the amount of rpc calls needed for `get_block_by_number`.
This function was causing me problems, every now and then a node would return a block with a different number than requested.

* change `serialize_hashable` to give the POW hashing blob.

Monero calculates the POW hash and the block hash using *slightly* different blobs :/

* make ring_signatures public and add length check when verifying.

* Misc improvements and bug fixes

---------

Co-authored-by: Luke Parker <lukeparker5132@gmail.com>
2023-11-12 10:18:18 -05:00
..
generators Correct no-std builds 2023-10-31 07:55:25 -04:00
src Monero: add more legacy verify functions (#383) 2023-11-12 10:18:18 -05:00
tests Use a single long-lived RPC connection when authenticated 2023-11-07 17:42:19 -05:00
build.rs Use a Vec for the Monero generators, preventing its massive stack usage 2023-09-20 04:31:16 -04:00
Cargo.toml Remove async_recursion for a for loop 2023-11-07 23:07:26 -05:00
LICENSE Update licenses 2023-01-11 23:05:31 -05:00
README.md Update Monero README 2023-03-31 07:02:57 -04:00

monero-serai

A modern Monero transaction library intended for usage in wallets. It prides itself on accuracy, correctness, and removing common pit falls developers may face.

monero-serai also offers the following features:

  • Featured Addresses
  • A FROST-based multisig orders of magnitude more performant than Monero's

Purpose and support

monero-serai was written for Serai, a decentralized exchange aiming to support Monero. Despite this, monero-serai is intended to be a widely usable library, accurate to Monero. monero-serai guarantees the functionality needed for Serai, yet will not deprive functionality from other users.

Various legacy transaction formats are not currently implemented, yet we are willing to add support for them. There aren't active development efforts around them however.

Caveats

This library DOES attempt to do the following:

  • Create on-chain transactions identical to how wallet2 would (unless told not to)
  • Not be detectable as monero-serai when scanning outputs
  • Not reveal spent outputs to the connected RPC node

This library DOES NOT attempt to do the following:

  • Have identical RPC behavior when creating transactions
  • Be a wallet

This means that monero-serai shouldn't be fingerprintable on-chain. It also shouldn't be fingerprintable if a targeted attack occurs to detect if the receiving wallet is monero-serai or wallet2. It also should be generally safe for usage with remote nodes.

It won't hide from remote nodes it's monero-serai however, potentially allowing a remote node to profile you. The implications of this are left to the user to consider.

It also won't act as a wallet, just as a transaction library. wallet2 has several non-transaction-level policies, such as always attempting to use two inputs to create transactions. These are considered out of scope to monero-serai.