monero-wallet 0.1.2

A Monero wallet implementation in Rust
Documentation
monero-wallet-0.1.2 has been yanked.

Monero Wallet in Rust

License: Apache 2.0 Build Status

A high-performance, secure, and fully-featured Monero wallet written in Rust.

Table of Contents

Overview

The Monero Wallet in Rust is an open-source project aiming to provide a robust, efficient, and secure wallet implementation for the Monero cryptocurrency using the Rust programming language. Leveraging Rust's safety guarantees and performance, this wallet offers enhanced security features and improved transaction handling capabilities. This is considered and Active work in progress.

Features

  • Secure Key Management: Implements advanced cryptographic primitives for secure key generation, storage, and management.
  • Fast Synchronization: Optimized blockchain synchronization using asynchronous I/O and efficient data structures.
  • Transaction Support: Full support for sending and receiving transactions, including RingCT and Bulletproofs.
  • Address Generation: Supports standard, sub-addresses, and integrated addresses.
  • Multisig Wallets: Ability to create and manage multisignature wallets.
  • RPC Interface: Provides a JSON-RPC interface for integration with other applications and services. (maybe/probably)
  • CLI: Intentions to implement some CLI functions also, no GUI planned at at this time.
  • Cross-Platform: Compatible with Windows, macOS, and Linux, and Android, probably iOS too.
  • Localization: Supports multiple languages for international users.
  • Modular Architecture: Designed with extensibility in mind, allowing for easy addition of new features.
  • Dart Bindings: Very likely I will create Dart bindings for easier higher-level use.

Getting Started

Prerequisites

  • Rust: Ensure you have Rust and Cargo installed. You can install Rust using rustup.
  • Monero Daemon: A running instance of the Monero daemon (monerod) to synchronize the blockchain. Alternatively, you can connect to a remote node.

Installation

Clone the repository and build the project:

git clone https://github.com/KewbitXMR/monero-wallet-sdk.git
cd monero-wallet-sdk
cargo build --release

This will produce an executable in the target/release directory.

Usage

Creating a Wallet

Create a new wallet with a mnemonic seed:

./monero-wallet create --name mywallet

You will be prompted to set a password and will receive a 25-word mnemonic seed. Store this seed securely!

Restoring a Wallet

Restore a wallet using your mnemonic seed:

./monero-wallet restore --name mywallet

Enter your mnemonic seed when prompted.

Sending Transactions

Send Monero to an address:

./monero-wallet send --address 84a5... --amount 1.5

Additional options:

  • --priority: Set the transaction priority (slow, normal, fast, fastest).
  • --payment-id: Include a payment ID for the transaction.

Receiving Transactions

The wallet automatically detects incoming transactions. Provide your address to the sender, which you can obtain with:

./monero-wallet address

Checking Balance

View your wallet's balance:

./monero-wallet balance

This will display both the unlocked and total balance.

Configuration

Customize wallet settings via a configuration file (config.toml) or command-line arguments.

Example config.toml:

[network]
daemon_address = "127.0.0.1:18081"
use_ssl = false

[wallet]
auto_refresh = true
refresh_interval = 30

Security

  • Encryption: All wallet files are encrypted using strong cryptographic algorithms.
  • Password Protection: Wallet access requires a password; ensure it's strong and unique.
  • Mnemonic Seed: The 25-word mnemonic seed is the key to your wallet. Keep it offline and never share it.
  • Updates: Regularly update to the latest version to incorporate security patches.

Performance

  • Asynchronous I/O: Uses tokio for non-blocking network operations.
  • Optimized Cryptography: Utilizes high-performance cryptographic libraries like curve25519-dalek and bulletproofs.
  • Parallel Processing: Leverages multicore processors for faster synchronization and transaction processing.

Integrating Dart

How we will likely hook into Dart:

import 'dart:ffi';
import 'package:ffi/ffi.dart';

// Define FFI bindings to Rust functions
typedef WalletCreateNewFunc = Pointer<Void> Function(Pointer<Utf8> configPath);
typedef WalletGetAddressFunc = Pointer<Utf8> Function(Pointer<Void> handle);
typedef WalletSendTransactionFunc = Int32 Function(
  Pointer<Void> handle,
  Pointer<Utf8> address,
  Double amount,
  Int32 priority,
  Pointer<Utf8> paymentId,
);

// build and load rs lib
final dylib = DynamicLibrary.open('path/to/your/wallet3.so');

// Lookup the functions
final walletCreateNew = dylib.lookupFunction<WalletCreateNewFunc, WalletCreateNewFunc>('wallet_create_new');
final walletGetAddress = dylib.lookupFunction<WalletGetAddressFunc, WalletGetAddressFunc>('wallet_get_address');
final walletSendTransaction = dylib.lookupFunction<WalletSendTransactionFunc, WalletSendTransactionFunc>('wallet_send_transaction');

Logging with Dart

You can pipe the logs into dart using FFI also:

final initializeLogger = dylib
    .lookup<NativeFunction<InitializeLoggerFunc>>('initialize_logger')
    .asFunction<InitializeLogger>();

// Initialize the logger
initializeLogger();

Contributing

Contributions are welcome! Please read our Contributing Guidelines before submitting a pull request.

To set up your development environment:

  1. Fork the repository.
  2. Create a new branch for your feature or bugfix.
  3. Write tests for your changes.
  4. Ensure all tests pass using cargo test.
  5. Submit a pull request with a detailed description of your changes.

License

This project is licensed under the Apache 2.0 License. See the LICENSE file for details.

Acknowledgements

  • Monero Project: For providing the original implementation and documentation.
  • Rust Community: For building an amazing language and ecosystem.
  • Contributors: Thanks to all the contributors who have helped make this project possible.

Disclaimer: This project is not officially affiliated with the Monero Project. Use at your own risk. Always verify the integrity of wallet software before use, you can visit the repo referenced on this page and build for yourself. In experidmental stages, not fit for perpose yet.

Project Aim: To develop a memory-guarded multi-instance wallet interface for Monero, leveraging Rust's memory safety guarantees to ensure secure, reliable operation even when multiple wallet instances are running simultaneously.