2022-04-22 01:36:18 +00:00
|
|
|
[package]
|
2022-04-28 02:48:58 +00:00
|
|
|
name = "monero-serai"
|
2023-03-21 00:28:41 +00:00
|
|
|
version = "0.1.4-alpha"
|
2022-08-25 08:02:30 +00:00
|
|
|
description = "A modern Monero transaction library"
|
2022-04-22 01:36:18 +00:00
|
|
|
license = "MIT"
|
2022-10-16 03:46:22 +00:00
|
|
|
repository = "https://github.com/serai-dex/serai/tree/develop/coins/monero"
|
2022-04-22 01:36:18 +00:00
|
|
|
authors = ["Luke Parker <lukeparker5132@gmail.com>"]
|
|
|
|
edition = "2021"
|
|
|
|
|
2022-09-28 12:44:49 +00:00
|
|
|
[package.metadata.docs.rs]
|
|
|
|
all-features = true
|
2022-09-29 08:47:55 +00:00
|
|
|
rustdoc-args = ["--cfg", "docsrs"]
|
2022-09-28 12:44:49 +00:00
|
|
|
|
2022-04-22 01:36:18 +00:00
|
|
|
[dependencies]
|
2023-06-29 01:16:33 +00:00
|
|
|
std-shims = { path = "../../common/std-shims", version = "0.1", default-features = false }
|
|
|
|
|
2023-06-29 08:14:29 +00:00
|
|
|
async-trait = { version = "0.1", default-features = false }
|
|
|
|
thiserror = { version = "1", optional = true }
|
2023-03-16 20:59:20 +00:00
|
|
|
|
2023-06-29 08:14:29 +00:00
|
|
|
zeroize = { version = "^1.5", default-features = false, features = ["zeroize_derive"] }
|
|
|
|
subtle = { version = "^2.4", default-features = false }
|
2022-04-22 01:36:18 +00:00
|
|
|
|
2023-06-29 08:14:29 +00:00
|
|
|
rand_core = { version = "0.6", default-features = false }
|
|
|
|
# Used to send transactions
|
|
|
|
rand = { version = "0.8", default-features = false }
|
|
|
|
rand_chacha = { version = "0.3", default-features = false }
|
|
|
|
# Used to select decoys
|
|
|
|
rand_distr = { version = "0.4", default-features = false }
|
2022-04-22 01:36:18 +00:00
|
|
|
|
2023-06-29 08:14:29 +00:00
|
|
|
crc = { version = "3", default-features = false }
|
|
|
|
sha3 = { version = "0.10", default-features = false }
|
2022-07-10 01:51:39 +00:00
|
|
|
|
2023-06-29 08:14:29 +00:00
|
|
|
curve25519-dalek = { version = "^3.2", default-features = false }
|
2022-04-22 01:36:18 +00:00
|
|
|
|
2023-06-29 08:14:29 +00:00
|
|
|
# Used for the hash to curve, along with the more complicated proofs
|
|
|
|
group = { version = "0.13", default-features = false }
|
|
|
|
dalek-ff-group = { path = "../../crypto/dalek-ff-group", version = "0.3", default-features = false }
|
|
|
|
multiexp = { path = "../../crypto/multiexp", version = "0.3", default-features = false, features = ["batch"] }
|
2022-04-22 01:36:18 +00:00
|
|
|
|
2023-06-29 08:14:29 +00:00
|
|
|
# Needed for multisig
|
|
|
|
transcript = { package = "flexible-transcript", path = "../../crypto/transcript", version = "0.3", default-features = false, features = ["recommended"], optional = true }
|
2023-03-16 23:29:22 +00:00
|
|
|
dleq = { path = "../../crypto/dleq", version = "0.3", features = ["serialize"], optional = true }
|
2023-06-29 08:14:29 +00:00
|
|
|
frost = { package = "modular-frost", path = "../../crypto/frost", version = "0.7", features = ["ed25519"], optional = true }
|
|
|
|
|
|
|
|
monero-generators = { path = "generators", version = "0.3", default-features = false }
|
2022-04-22 01:36:18 +00:00
|
|
|
|
2023-06-29 08:14:29 +00:00
|
|
|
futures = { version = "0.3", default-features = false, features = ["alloc"], optional = true }
|
2022-08-21 10:36:53 +00:00
|
|
|
|
Monero: support for legacy transactions (#308)
* add mlsag
* fix last commit
* fix miner v1 txs
* fix non-miner v1 txs
* add borromean + fix mlsag
* add block hash calculations
* fix for the jokester that added unreduced scalars
to the borromean signature of
2368d846e671bf79a1f84c6d3af9f0bfe296f043f50cf17ae5e485384a53707b
* Add Borromean range proof verifying functionality
* Add MLSAG verifying functionality
* fmt & clippy :)
* update MLSAG, ss2_elements will always be 2
* Add MgSig proving
* Tidy block.rs
* Tidy Borromean, fix bugs in last commit, replace todo! with unreachable!
* Mark legacy EcdhInfo amount decryption as experimental
* Correct comments
* Write a new impl of the merkle algorithm
This one tries to be understandable.
* Only pull in things only needed for experimental when experimental
* Stop caching the Monero block hash now in processor that we have Block::hash
* Corrections for recent processor commit
* Use a clearer algorithm for the merkle
Should also be more efficient due to not shifting as often.
* Tidy Mlsag
* Remove verify_rct_* from Mlsag
Both methods were ports from Monero, overtly specific without clear
documentation. They need to be added back in, with documentation, or included
in a node which provides the necessary further context for them to be naturally
understandable.
* Move mlsag/mod.rs to mlsag.rs
This should only be a folder if it has multiple files.
* Replace EcdhInfo terminology
The ECDH encrypted the amount, yet this struct contained the encrypted amount,
not some ECDH.
Also corrects the types on the original EcdhInfo struct.
* Correct handling of commitment masks when scanning
* Route read_array through read_raw_vec
* Misc lint
* Make a proper RctType enum
No longer caches RctType in the RctSignatures as well.
* Replace Vec<Bulletproofs> with Bulletproofs
Monero uses aggregated range proofs, so there's only ever one Bulletproof. This
is enforced with a consensus rule as well, making this safe.
As for why Monero uses a vec, it's probably due to the lack of variadic typing
used. Its effectively an Option for them, yet we don't need an Option since we
do have variadic typing (enums).
* Add necessary checks to Eventuality re: supported protocols
* Fix for block 202612 and fix merkel root calculations
* MLSAG (de)serialisation fix
ss_2_elements will not always be 2 as rct type 1 transactions are not enforced to have one input
* Revert "MLSAG (de)serialisation fix"
This reverts commit 5e710e0c96658092c6ecfe5e4ea5a9c3dbee3ab3.
here it checks number of MGs == number of inputs:
https://github.com/monero-project/monero/blob/0a1eaf26f9dd6b762c2582ee12603b2a4671c735/src/cryptonote_core/tx_verification_utils.cpp#L60-59
and here it checks for RctTypeFull number of MGs == 1:
https://github.com/monero-project/monero/blob/0a1eaf26f9dd6b762c2582ee12603b2a4671c735/src/ringct/rctSigs.cpp#L1325
so number of inputs == 1
so ss_2_elements == 2
* update `MlsagAggregate` comment
* cargo update
Resolves a yanked crate
* Move location of serai-client in Cargo.toml
---------
Co-authored-by: Luke Parker <lukeparker5132@gmail.com>
2023-07-04 21:18:05 +00:00
|
|
|
hex-literal = "0.4"
|
2023-06-29 08:14:29 +00:00
|
|
|
hex = { version = "0.4", default-features = false, features = ["alloc"] }
|
|
|
|
serde = { version = "1", default-features = false, features = ["derive"] }
|
|
|
|
serde_json = { version = "1", default-features = false, features = ["alloc"] }
|
2022-07-10 01:51:39 +00:00
|
|
|
|
2023-06-29 08:14:29 +00:00
|
|
|
base58-monero = { version = "1", git = "https://github.com/monero-rs/base58-monero", rev = "5045e8d2b817b3b6c1190661f504e879bc769c29", default-features = false, features = ["check"] }
|
2022-07-10 01:51:39 +00:00
|
|
|
|
2023-06-29 08:14:29 +00:00
|
|
|
# Used for the provided RPC
|
|
|
|
digest_auth = { version = "0.3", optional = true }
|
|
|
|
reqwest = { version = "0.11", features = ["json"], optional = true }
|
2022-04-22 01:36:18 +00:00
|
|
|
|
2023-07-05 22:49:32 +00:00
|
|
|
# Used for the binaries
|
|
|
|
tokio = { version = "1", features = ["full"], optional = true }
|
|
|
|
|
2022-08-21 10:36:53 +00:00
|
|
|
[build-dependencies]
|
2023-06-29 08:14:29 +00:00
|
|
|
dalek-ff-group = { path = "../../crypto/dalek-ff-group", version = "0.3", default-features = false }
|
|
|
|
monero-generators = { path = "generators", version = "0.3", default-features = false }
|
2022-08-21 10:36:53 +00:00
|
|
|
|
2022-04-22 01:36:18 +00:00
|
|
|
[dev-dependencies]
|
2022-05-06 11:33:44 +00:00
|
|
|
tokio = { version = "1", features = ["full"] }
|
2023-01-16 21:17:54 +00:00
|
|
|
monero-rpc = "0.3"
|
2022-10-16 03:46:22 +00:00
|
|
|
|
2023-03-21 00:28:41 +00:00
|
|
|
frost = { package = "modular-frost", path = "../../crypto/frost", version = "0.7", features = ["tests"] }
|
2022-10-16 03:46:22 +00:00
|
|
|
|
|
|
|
[features]
|
2023-06-29 08:14:29 +00:00
|
|
|
std = [
|
|
|
|
"std-shims/std",
|
|
|
|
|
|
|
|
"thiserror",
|
|
|
|
|
|
|
|
"zeroize/std",
|
|
|
|
"subtle/std",
|
|
|
|
|
|
|
|
"rand_core/std",
|
|
|
|
"rand_chacha/std",
|
|
|
|
"rand/std",
|
|
|
|
"rand_distr/std",
|
|
|
|
|
|
|
|
"sha3/std",
|
|
|
|
|
|
|
|
"curve25519-dalek/std",
|
|
|
|
|
|
|
|
"multiexp/std",
|
|
|
|
|
|
|
|
"monero-generators/std",
|
|
|
|
|
|
|
|
"futures/std",
|
|
|
|
|
|
|
|
"hex/std",
|
|
|
|
"serde/std",
|
|
|
|
"serde_json/std",
|
|
|
|
]
|
Monero: support for legacy transactions (#308)
* add mlsag
* fix last commit
* fix miner v1 txs
* fix non-miner v1 txs
* add borromean + fix mlsag
* add block hash calculations
* fix for the jokester that added unreduced scalars
to the borromean signature of
2368d846e671bf79a1f84c6d3af9f0bfe296f043f50cf17ae5e485384a53707b
* Add Borromean range proof verifying functionality
* Add MLSAG verifying functionality
* fmt & clippy :)
* update MLSAG, ss2_elements will always be 2
* Add MgSig proving
* Tidy block.rs
* Tidy Borromean, fix bugs in last commit, replace todo! with unreachable!
* Mark legacy EcdhInfo amount decryption as experimental
* Correct comments
* Write a new impl of the merkle algorithm
This one tries to be understandable.
* Only pull in things only needed for experimental when experimental
* Stop caching the Monero block hash now in processor that we have Block::hash
* Corrections for recent processor commit
* Use a clearer algorithm for the merkle
Should also be more efficient due to not shifting as often.
* Tidy Mlsag
* Remove verify_rct_* from Mlsag
Both methods were ports from Monero, overtly specific without clear
documentation. They need to be added back in, with documentation, or included
in a node which provides the necessary further context for them to be naturally
understandable.
* Move mlsag/mod.rs to mlsag.rs
This should only be a folder if it has multiple files.
* Replace EcdhInfo terminology
The ECDH encrypted the amount, yet this struct contained the encrypted amount,
not some ECDH.
Also corrects the types on the original EcdhInfo struct.
* Correct handling of commitment masks when scanning
* Route read_array through read_raw_vec
* Misc lint
* Make a proper RctType enum
No longer caches RctType in the RctSignatures as well.
* Replace Vec<Bulletproofs> with Bulletproofs
Monero uses aggregated range proofs, so there's only ever one Bulletproof. This
is enforced with a consensus rule as well, making this safe.
As for why Monero uses a vec, it's probably due to the lack of variadic typing
used. Its effectively an Option for them, yet we don't need an Option since we
do have variadic typing (enums).
* Add necessary checks to Eventuality re: supported protocols
* Fix for block 202612 and fix merkel root calculations
* MLSAG (de)serialisation fix
ss_2_elements will not always be 2 as rct type 1 transactions are not enforced to have one input
* Revert "MLSAG (de)serialisation fix"
This reverts commit 5e710e0c96658092c6ecfe5e4ea5a9c3dbee3ab3.
here it checks number of MGs == number of inputs:
https://github.com/monero-project/monero/blob/0a1eaf26f9dd6b762c2582ee12603b2a4671c735/src/cryptonote_core/tx_verification_utils.cpp#L60-59
and here it checks for RctTypeFull number of MGs == 1:
https://github.com/monero-project/monero/blob/0a1eaf26f9dd6b762c2582ee12603b2a4671c735/src/ringct/rctSigs.cpp#L1325
so number of inputs == 1
so ss_2_elements == 2
* update `MlsagAggregate` comment
* cargo update
Resolves a yanked crate
* Move location of serai-client in Cargo.toml
---------
Co-authored-by: Luke Parker <lukeparker5132@gmail.com>
2023-07-04 21:18:05 +00:00
|
|
|
|
2023-06-29 08:14:29 +00:00
|
|
|
http_rpc = ["digest_auth", "reqwest"]
|
|
|
|
multisig = ["transcript", "frost", "dleq", "std"]
|
2023-07-05 22:49:32 +00:00
|
|
|
binaries = ["tokio"]
|
Monero: support for legacy transactions (#308)
* add mlsag
* fix last commit
* fix miner v1 txs
* fix non-miner v1 txs
* add borromean + fix mlsag
* add block hash calculations
* fix for the jokester that added unreduced scalars
to the borromean signature of
2368d846e671bf79a1f84c6d3af9f0bfe296f043f50cf17ae5e485384a53707b
* Add Borromean range proof verifying functionality
* Add MLSAG verifying functionality
* fmt & clippy :)
* update MLSAG, ss2_elements will always be 2
* Add MgSig proving
* Tidy block.rs
* Tidy Borromean, fix bugs in last commit, replace todo! with unreachable!
* Mark legacy EcdhInfo amount decryption as experimental
* Correct comments
* Write a new impl of the merkle algorithm
This one tries to be understandable.
* Only pull in things only needed for experimental when experimental
* Stop caching the Monero block hash now in processor that we have Block::hash
* Corrections for recent processor commit
* Use a clearer algorithm for the merkle
Should also be more efficient due to not shifting as often.
* Tidy Mlsag
* Remove verify_rct_* from Mlsag
Both methods were ports from Monero, overtly specific without clear
documentation. They need to be added back in, with documentation, or included
in a node which provides the necessary further context for them to be naturally
understandable.
* Move mlsag/mod.rs to mlsag.rs
This should only be a folder if it has multiple files.
* Replace EcdhInfo terminology
The ECDH encrypted the amount, yet this struct contained the encrypted amount,
not some ECDH.
Also corrects the types on the original EcdhInfo struct.
* Correct handling of commitment masks when scanning
* Route read_array through read_raw_vec
* Misc lint
* Make a proper RctType enum
No longer caches RctType in the RctSignatures as well.
* Replace Vec<Bulletproofs> with Bulletproofs
Monero uses aggregated range proofs, so there's only ever one Bulletproof. This
is enforced with a consensus rule as well, making this safe.
As for why Monero uses a vec, it's probably due to the lack of variadic typing
used. Its effectively an Option for them, yet we don't need an Option since we
do have variadic typing (enums).
* Add necessary checks to Eventuality re: supported protocols
* Fix for block 202612 and fix merkel root calculations
* MLSAG (de)serialisation fix
ss_2_elements will not always be 2 as rct type 1 transactions are not enforced to have one input
* Revert "MLSAG (de)serialisation fix"
This reverts commit 5e710e0c96658092c6ecfe5e4ea5a9c3dbee3ab3.
here it checks number of MGs == number of inputs:
https://github.com/monero-project/monero/blob/0a1eaf26f9dd6b762c2582ee12603b2a4671c735/src/cryptonote_core/tx_verification_utils.cpp#L60-59
and here it checks for RctTypeFull number of MGs == 1:
https://github.com/monero-project/monero/blob/0a1eaf26f9dd6b762c2582ee12603b2a4671c735/src/ringct/rctSigs.cpp#L1325
so number of inputs == 1
so ss_2_elements == 2
* update `MlsagAggregate` comment
* cargo update
Resolves a yanked crate
* Move location of serai-client in Cargo.toml
---------
Co-authored-by: Luke Parker <lukeparker5132@gmail.com>
2023-07-04 21:18:05 +00:00
|
|
|
experimental = []
|
|
|
|
|
2023-06-29 08:14:29 +00:00
|
|
|
default = ["std", "http_rpc"]
|