Skip to content

whs-dot-hk/glacier-drop-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Daedalue - Cardano Key Management and COSE Signing

A Rust implementation for Cardano key derivation and COSE Sign1 message signing using BIP39 mnemonics.

Features

  • ✅ BIP39 mnemonic phrase support
  • ✅ BIP32 key derivation using from_bip39_entropy
  • ✅ Cardano stake key derivation (m/1852'/1815'/0'/2/0)
  • ✅ Cardano stake address (reward address) generation
  • ✅ COSE Sign1 format message signing with custom headers
  • ✅ Ed25519 signature verification

How to Run

⚠️ Security Warning

CRITICAL SECURITY PROCEDURE: To ensure maximum security when handling your mnemonic phrase, follow these steps exactly. Your mnemonic phrase should never be entered while connected to the internet.

Secure Build and Run Process

Phase 1: Initial Setup (Internet Connected)

  1. Build the project first to download all dependencies:
cargo build --release

Phase 2: Secure Operation (Internet Disconnected)

  1. Disconnect from the internet completely
  2. Update the mnemonic phrase in the mnemonic_phrase variable in daedalue/src/main.rs
  3. Set your message to sign in the message variable in daedalue/src/main.rs
  4. Build again with your changes:
cargo build --release
  1. Run the application:
# Run with cargo
cargo run

# Or run the release binary directly
./target/release/daedalue

Phase 3: Cleanup (Still Internet Disconnected)

  1. Format the disk and reinstall the OS to completely remove any traces of the mnemonic phrase

Output

The application will output:

  • Public key (hex encoded)
  • Cardano stake address (bech32 format)
  • Message being signed
  • COSE Sign1 formatted signature (hex encoded)
  • Signature verification result

Dependencies (not audited)

  • bip39 (2.2) - BIP39 mnemonic phrase handling
  • cardano-serialization-lib (15.0) - Cardano cryptographic operations and BIP32 key derivation
  • serde_cbor (0.11) - CBOR serialization for COSE format
  • hex (0.4) - Hexadecimal encoding/decoding
  • anyhow (1.0) - Error handling

Implementation Notes

This implementation uses Cardano's standard BIP32 key derivation with from_bip39_entropy to create the root key from the mnemonic seed. The key derivation follows the standard BIP32-Ed25519 specification used by Cardano.

The COSE Sign1 format follows the CBOR Object Signing and Encryption (COSE) standard for message authentication, with custom protected headers including the algorithm identifier (-8 for EdDSA) and the Cardano address.


Note: This implementation was successfully used to claim the glacier drop. Reference implementation available at: https://github.com/whs-dot-hk/message-signing/blob/test/examples/rust/src/main.rs

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages