Skip to main content

hardware-wallets

Sign Ethereum transactions with Ledger and Trezor hardware wallets using Nethereum. Use this skill whenever the user asks about Ledger signing, Trezor signing, hardware wallet integration, HSM device signing, external signers, or hardware security modules for Ethereum in C#/.NET.

Ir a la instalación

Datos de origen

Repositorio
Nethereum/Nethereum
Última actividad en el origen
14 de marzo de 2026 a las 12:48
Idioma detectado de SKILL.md
inglés
Estrellas
2260
Forks
744

Opciones de instalación

De forma predeterminada está seleccionado el prompt que primero revisa el origen. Puedes cambiar a un comando directo o descargar una copia local.

Revisa los archivos de origen

Lee SKILL.md y los archivos complementarios que muestra SkillsMP antes de decidir si quieres instalarlo.

Mostrando SKILL.md

SKILL.md
Instrucciones de origen · Vista previa de solo lectura
name
hardware-wallets
description
Sign Ethereum transactions with Ledger and Trezor hardware wallets using Nethereum. Use this skill whenever the user asks about Ledger signing, Trezor signing, hardware wallet integration, HSM device signing, external signers, or hardware security modules for Ethereum in C#/.NET.
user-invocable
true
# Hardware Wallets with Nethereum Private key never leaves the device. Both use the `ExternalAccount` pattern. ## Ledger NuGet: `Nethereum.Signer.Ledger` ```bash dotnet add package Nethereum.Signer.Ledger ``` ```csharp using Nethereum.Ledger; using Nethereum.Web3; using Nethereum.Web3.Accounts; var ledgerManagerFactory = new NethereumLedgerManagerBrokerFactory(); var signer = new LedgerExternalSigner(ledgerManagerFactory, accountIndex: 0); var externalAccount = new ExternalAccount(signer, chainId: 1); await externalAccount.InitialiseAsync(); var web3 = new Web3(externalAccount, "https://your-rpc-url"); // Send transaction (same API as regular Account) var receipt = await web3.Eth.GetEtherTransferService() .TransferEtherAndWaitForReceiptAsync(toAddress, 0.1m); ``` ### Legacy Path (Electrum/Ledger) ```csharp var signer = new LedgerExternalSigner(ledgerManagerFactory, accountIndex: 0, legacyPath: true); // Uses m/44'/60'/0'/x instead of m/44'/60'/0'/0/x ``` ## Trezor NuGet: `Nethereum.Signer.Trezor` ```bash dotnet add package Nethereum.Signer.Trezor ``` Requires a PIN prompt handler: ```csharp using Nethereum.Trezor; using Nethereum.Web3; using Nethereum.Web3.Accounts; public class ConsolePinHandler : ITrezorPromptHandler { public Task<string> PromptPin() { Console.Write("Enter PIN (numpad positions): "); return Task.FromResult(Console.ReadLine()); } public Task<string> PromptPassphrase() { Console.Write("Enter passphrase (or empty): "); return Task.FromResult(Console.ReadLine()); } } var pinHandler = new ConsolePinHandler(); var trezorManagerFactory = new NethereumTrezorManagerBrokerFactory(); var signer = new TrezorExternalSigner(trezorManagerFactory, pinHandler, accountIndex: 0); var externalAccount = new ExternalAccount(signer, chainId: 1); await externalAccount.InitialiseAsync(); var web3 = new Web3(externalAccount, "https://your-rpc-url"); ``` ### Personal Message Signing (Trezor only) ```csharp var signature = await signer.SignAsync( System.Text.Encoding.UTF8.GetBytes("Hello Ethereum!")); ``` ## Comparison | Feature | Ledger | Trezor | |---|---|---| | EIP-712 signing | No | Yes | | Personal message signing | No | Yes | | PIN entry | On device | Via handler | | Passphrase (25th word) | On device | Via handler | For full documentation, see: https://docs.nethereum.com/docs/signing-and-key-management/guide-hardware-wallets
Ver en GitHub