Skip to content

Adding Cold Signing functionality #5

@williamcanin

Description

@williamcanin

Adding Cold Signing functionality:
Use the alloy crate for EVM.

The flow would be:

  • The user pastes the Unsigned Transaction Hex (which they got from Rabby) into their program.

  • The seedctl derives the Private Key from the Seed (which you already create).

  • The alloy signs this Hex using the Private Key and the Chain ID (e.g., 1 for Ethereum, 56 for BSC).

  • The seedctl outputs the Signed Hex.

Example:

// Conceptual example with Alloy
use alloy_signer_local::LocalSigner;
use alloy_primitives::Bytes;

// 1. Loads the private key from your Seed logic.
let signer: LocalSigner<SigningKey> = private_key.parse()?;

// 2. Receives the hex data from the unsigned transaction (coming from Rabby).
let unsigned_tx_bytes = Bytes::from_str("0x...")?;

// 3. Sign (Offline)
let signature = signer.sign_transaction(&unsigned_tx).await?;

For Bitcoin, the best practice is the PSBT (BIP-174) standard. This is exactly what Electrum and Hardware Wallets use.

Suggested library: rust-bitcoin.

Flow: The online wallet generates a .psbt file. Your program reads this file, applies the signature with the Private Key, and returns the signed PSBT.

Suggested Architectural Design for the New Menu:

-> Manage Seeds (Generate or Import)

-> Derive Addresses (BTC, ETH/EVM, SOL)

-> Sign Offline Transaction (Cold Sign)

	-> Bitcoin (via PSBT)

	-> EVM (via Raw Hex / EIP-155)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions