Hardware Wallets
Apps & Automationhardware-walletsHardware Wallets is an Agent Skill for apps & automation published in the Nethereum/Nethereum repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
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.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/Nethereum/Nethereum/blob/HEAD/plugins/nethereum-skills/skills/hardware-wallets/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/hardware-wallets, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Hardware Wallets with Nethereum
Private key never leaves the device. Both use the ExternalAccount pattern.
Ledger
NuGet: Nethereum.Signer.Ledger
dotnet add package Nethereum.Signer.Ledger
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)
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
dotnet add package Nethereum.Signer.Trezor
Requires a PIN prompt handler:
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)
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