Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.1.0 #22

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ resolver = "2"

[workspace.package]
edition = "2021"
authors = ["Ideal Labs <driemworks@idealabs.network>"]
authors = ["Ideal Labs <hello@idealabs.network>"]
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 }
Expand Down
32 changes: 24 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -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).
7 changes: 7 additions & 0 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
33 changes: 26 additions & 7 deletions core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

- **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).
1 change: 1 addition & 0 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 7 additions & 0 deletions lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
67 changes: 52 additions & 15 deletions lib/README.md
Original file line number Diff line number Diff line change
@@ -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
```
```

## 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).
9 changes: 3 additions & 6 deletions lib/src/bin/murmur/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -102,12 +103,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
}

// 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);
Expand Down
1 change: 1 addition & 0 deletions test-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "murmur-test-utils"
version = "0.1.0"
edition = "2021"
description = "Murmur test utils"
authors.workspace = true
license.workspace = true

Expand Down
14 changes: 13 additions & 1 deletion test-utils/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# Murmur test utilities

Various test utilities for murmur.
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).
1 change: 1 addition & 0 deletions test-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down