From 8c05dfe04a6d5de4b5432975eb71a1eefc3e9897 Mon Sep 17 00:00:00 2001 From: Juan Girini Date: Mon, 14 Oct 2024 17:58:06 +0200 Subject: [PATCH] chore: improve readme check licenses and cargo files --- CHANGELOG.md | 17 ++++++++++ Cargo.toml | 3 +- README.md | 32 +++++++++++++----- core/Cargo.toml | 7 ++++ core/README.md | 33 +++++++++++++++---- core/src/lib.rs | 1 + lib/Cargo.toml | 7 ++++ lib/README.md | 67 +++++++++++++++++++++++++++++--------- lib/src/bin/murmur/main.rs | 9 ++--- test-utils/Cargo.toml | 1 + test-utils/README.md | 14 +++++++- test-utils/src/lib.rs | 1 + 12 files changed, 154 insertions(+), 38 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..5237368 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,17 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [0.1.0] - 2023-10-14 + +### Added + +- Initial implementation of the Murmur API. + +[unreleased]: https://github.com/ideal-lab5/murmur/compare/v0.1.0...HEAD +[0.1.0]: https://github.com/ideal-lab5/murmur/releases/tag/v0.1.0 diff --git a/Cargo.toml b/Cargo.toml index e17a2f7..bc4e6ba 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,10 +8,11 @@ resolver = "2" [workspace.package] edition = "2021" -authors = ["Ideal Labs "] +authors = ["Ideal Labs "] repository = "https://github.com/ideal-lab5/murmur" homepage = "https://idealabs.network" license = "Apache-2.0" +description = "Murmur crates" [workspace.lints.rust] suspicious_double_ref_op = { level = "allow", priority = 2 } diff --git a/README.md b/README.md index 6c6bfe0..99569b4 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,39 @@ # Murmur -Murmur is an air-gapped keyless crypto wallet protocol that runs on the [Ideal Network](). This repository contains the core implementation of the murmur protocol and a CLI to allow fully non-custodial usage of murmur wallets. +Murmur is an air-gapped keyless crypto wallet protocol that runs on the [Ideal Network](https://idealabs.network). This repository contains the core implementation of the murmur protocol and a CLI to allow fully non-custodial usage of murmur wallets. -The murmur protocol enables **keyless account abstraction** capabilities for any chain bridged to the Ideal Network (alternatively, we can do this with drand). wallet is a special pure proxy that can only be executed when presented with proof that the origin knows a correct time-based OTP code. +The murmur protocol enables **keyless account abstraction** capabilities for any chain bridged to the Ideal Network (alternatively, we can do this with drand). wallet is a special pure proxy that can only be executed when presented with proof that the origin knows a correct time-based OTP code. -It is based on the [Hours of Horus](https://eprint.iacr.org/2021/715) protocol, which leverages timelock encryption and a secure OTP code generator to construct a keyless wallet scheme. Our scheme improves on this construction in several ways. +It is based on the [Hours of Horus](https://eprint.iacr.org/2021/715) protocol, which leverages timelock encryption and a secure OTP code generator to construct a keyless wallet scheme. Our scheme improves on this construction in several ways. -- We leverage the Ideal Network to instantiate practical timelock encryption, allowing the HoH scheme to be realized in the first place. -- We use a Merkle mountain range in place of a Merkle tree, allowing for arbitrary numbers of OTP codes to be generated -- JIT execution: Rather than relying on a commit-reveal scheme in order to use the wallet, our scheme uses a 'just-in-time' approach leveraging the Ideal Network's on-chain randomness, which provides the decryption key (i.e. BLS signature) necessary to verify proofs. +- **Practical Timelock Encryption**: We leverage the Ideal Network to instantiate practical timelock encryption, allowing the HoH scheme to be realized in the first place. +- **Merkle Mountain Range**: We use a Merkle mountain range in place of a Merkle tree, allowing for arbitrary numbers of OTP codes to be generated +- **Just-in-Time Execution**: Rather than relying on a commit-reveal scheme in order to use the wallet, our scheme uses a 'just-in-time' approach leveraging the Ideal Network's on-chain randomness, which provides the decryption key (i.e. BLS signature) necessary to verify proofs. ## Build -``` +To build the project, use the following command: + +```shell cargo build ``` ## Testing -``` +To run the tests, use the following command: + +```shell cargo test ``` + +## Contributing + +Contributions are welcome! Please open an issue or submit a pull request. + +## License + +This project is licensed under the Apache-2.0. See the [LICENSE](LICENSE) file for details. + +## Contact + +For any inquiries, please contact [Ideal Labs](https://idealabs.network). diff --git a/core/Cargo.toml b/core/Cargo.toml index cee6b81..462aa80 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -2,8 +2,15 @@ name = "murmur-core" version = "0.1.0" edition = "2021" +description = "Murmur core" +documentation = "https://docs.rs/murmur-core" +readme = "README.md" +keywords = ["crypto", "wallet", "keyless"] +categories = ["development-tools", "cryptography"] authors.workspace = true license.workspace = true +repository.workspace = true +homepage.workspace = true [lints] workspace = true diff --git a/core/README.md b/core/README.md index 9efec1d..b058f88 100644 --- a/core/README.md +++ b/core/README.md @@ -4,26 +4,45 @@ This library contains the core implementation of the murmur protocol. This imple ## Build -``` shell +To build the library, use the following command: + +```shell cargo build ``` -The OTP code generator is gated under the "client" feature, so build with: -``` shell +The OTP code generator is gated under the "client" feature. To build with this feature enabled, use: + +```shell cargo build --features "client" ``` ## Test -``` shell +To run the tests, use the following command: + +```shell cargo test ``` The OTP code generator is gated under the "client" feature, so run tests with: -``` shell + +```shell cargo test --features "client" ``` ## Future Work/Notes -- There is an 'otpauth' feature that can be enabled on the totp lib. It allows for the inclusion of an issuer and account_name. We can investigate usage of this in the future. https://github.com/constantoine/totp-rs/blob/da78569b0c233adbce126dbe0c35452340fd3929/src/lib.rs#L160 -- Wallet Update logic: Each murmur wallet is ephemeral, since any MMR must be limited in size. We can use a zkp to prove knowledge of the seed in order to allow the wallet owner to update the wallet by providing a new MMR root. \ No newline at end of file + +- **OTPAuth Feature**: There is an 'otpauth' feature that can be enabled on the totp lib. It allows for the inclusion of an issuer and account_name. We can investigate usage of this in the future. [TOTP Library Reference](https://github.com/constantoine/totp-rs/blob/da78569b0c233adbce126dbe0c35452340fd3929/src/lib.rs#L160) +- **Wallet Update logic**: Each murmur wallet is ephemeral, since any MMR must be limited in size. We can use a zkp to prove knowledge of the seed in order to allow the wallet owner to update the wallet by providing a new MMR root. + +## Contributing + +Contributions are welcome! Please open an issue or submit a pull request. + +## License + +This project is licensed under the Apache-2.0. See the [LICENSE](../LICENSE) file for details. + +## Contact + +For any inquiries, please contact [Ideal Labs](https://idealabs.network). \ No newline at end of file diff --git a/core/src/lib.rs b/core/src/lib.rs index e47ddb9..430421b 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + #![cfg_attr(not(feature = "std"), no_std)] //! the murmur core library diff --git a/lib/Cargo.toml b/lib/Cargo.toml index b0df26f..cb1e731 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -2,8 +2,15 @@ name = "murmur-lib" version = "0.1.0" edition = "2021" +description = "Murmur library" +documentation = "https://docs.rs/murmur-lib" +readme = "README.md" +keywords = ["crypto", "wallet", "keyless"] +categories = ["development-tools", "command-line-interface"] authors.workspace = true license.workspace = true +repository.workspace = true +homepage.workspace = true [lib] crate-type = [ diff --git a/lib/README.md b/lib/README.md index 6506c64..d7312b4 100644 --- a/lib/README.md +++ b/lib/README.md @@ -1,51 +1,88 @@ -# murmur-lib +# Murmur Lib An implementation of the Murmur protocol and corresponding CLI. This implements the Murmur protocol for usage with the Ideal network's randomness beacon. Specifically, it uses [TinyBLS377](https://docs.rs/w3f-bls/latest/w3f_bls/engine/type.TinyBLS377.html) and constructs basic identities which are deterministic based on block number. ## Setup To setup a dev environment: -- run a local [IDN solochain node](https://github.com/ideal-lab5/etf) -- [generate chain metadata](#generate-metadata) + +1. Run a local [IDN solochain node](https://github.com/ideal-lab5/etf) +2. [Generate chain metadata](#generate-metadata) ### Build -`cargo build` +To build the project, use the following command: + +```shell +cargo build +``` ### CLI Usage ##### Create a wallet -``` shell -# generate a wallet valid for the next 1000 blocks +To generate a wallet valid for the next 1000 blocks, use: + +```shell ./target/debug/murmur new --name test --seed my_secret_key --validity 100 ``` ##### Execute a balance transfer -``` shell -# send a balance transfer +To send a balance transfer, use: + +```shell ./target/debug/murmur execute --name test --seed my_secret_key --to CuqfkE3QieYPAWPpwiygDufmyrKecDcVCF7PN1psaLEn8yr --amount 100_000_000 ``` ## Test -`cargo test` +To run the tests, use the following command: +```shell +cargo test +``` ## Generate Metadata -``` shell -# clone and build the node +To run the tests, use the following command: + +1. Clone and build the node: + +```shell git clone git@github.com:ideal-lab5/etf.git cd etf cargo +stable build -# run a local node +``` + +2. Run a local node: + +```shell ./target/debug/node --tmp --dev --alice --unsafe-rpc-external --rpc-cors all -# use subxt to prepare metadata +``` + +3. Prepare metadata using `subxt`: + +```shel cd /path/to/otp-wallet/ mkdir artifacts cargo install subxt-cli -# Download and save all of the metadata: +``` + +4. Download and save all of the metadata: + +```shell subxt metadata > ./artifacts/metadata.scale -``` \ No newline at end of file +``` + +## Contributing + +Contributions are welcome! Please open an issue or submit a pull request. + +## License + +This project is licensed under the Apache-2.0. See the [LICENSE](../LICENSE) file for details. + +## Contact + +For any inquiries, please contact [Ideal Labs](https://idealabs.network). diff --git a/lib/src/bin/murmur/main.rs b/lib/src/bin/murmur/main.rs index 59f99fa..5337c2d 100644 --- a/lib/src/bin/murmur/main.rs +++ b/lib/src/bin/murmur/main.rs @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + use clap::{Parser, Subcommand}; use murmur_lib::{ create, etf, idn_connect, prepare_execute, BlockNumber, BoundedVec, MurmurStore, RuntimeCall, @@ -102,12 +103,8 @@ async fn main() -> Result<(), Box> { } // 2. create mmr - let create_data = create( - args.seed.as_bytes().to_vec(), - schedule, - round_pubkey_bytes, - ) - .map_err(|_| CLIError::MurmurCreationFailed)?; + let create_data = create(args.seed.as_bytes().to_vec(), schedule, round_pubkey_bytes) + .map_err(|_| CLIError::MurmurCreationFailed)?; // 3. add to storage write_mmr_store(create_data.mmr_store.clone(), MMR_STORE_FILEPATH); diff --git a/test-utils/Cargo.toml b/test-utils/Cargo.toml index 611560e..ad4742e 100644 --- a/test-utils/Cargo.toml +++ b/test-utils/Cargo.toml @@ -2,6 +2,7 @@ name = "murmur-test-utils" version = "0.1.0" edition = "2021" +description = "Murmur test utils" authors.workspace = true license.workspace = true diff --git a/test-utils/README.md b/test-utils/README.md index 1f3ffd5..53ec9ac 100644 --- a/test-utils/README.md +++ b/test-utils/README.md @@ -1,3 +1,15 @@ # Murmur test utilities -Various test utilities for murmur. \ No newline at end of file +Various test utilities for murmur. + +## Contributing + +Contributions are welcome! Please open an issue or submit a pull request. + +## License + +This project is licensed under the Apache-2.0. See the [LICENSE](../LICENSE) file for details. + +## Contact + +For any inquiries, please contact [Ideal Labs](https://idealabs.network). diff --git a/test-utils/src/lib.rs b/test-utils/src/lib.rs index bea82b2..69a239d 100644 --- a/test-utils/src/lib.rs +++ b/test-utils/src/lib.rs @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + #![no_std] //! various utilities helpful for testing