| Crates.io | yubikey_ed25519_crpyto |
| lib.rs | yubikey_ed25519_crpyto |
| version | 0.1.2 |
| created_at | 2025-04-24 09:58:51.452518+00 |
| updated_at | 2025-04-24 11:53:13.727257+00 |
| description | YubiKey OpenPGP card signing for Ed25519 based crypto signatures |
| homepage | |
| repository | https://github.com/stars-labs/yubikey-ed25519-crypto |
| max_upload_size | |
| id | 1646970 |
| size | 200,183 |
yubikey_ed25519_crpyto)A Rust library and CLI example for constructing and signing Solana transactions using a YubiKey's OpenPGP card (Ed25519).
Add to your Cargo.toml:
[dependencies]
yubikey_ed25519_crpyto = { path = "./yubikey_ed25519_crpyto" }
solana-sdk = "1.17"
solana-client = "1.17"
use yubikey_ed25519_crpyto::get_pubkey_from_yubikey;
let pubkey_bytes = get_pubkey_from_yubikey()?;
// Use pubkey_bytes as a Solana Pubkey, e.g.:
let pubkey = solana_sdk::pubkey::Pubkey::from(pubkey_bytes);
use yubikey_ed25519_crpyto::sign_with_yubikey;
// `msg_data` is the serialized Solana message bytes
let signature_bytes = sign_with_yubikey(&msg_data)?;
// Use signature_bytes as the signature for your transaction
A ready-to-use CLI is provided in examples/main.rs.
cargo run --example main -p yubikey_ed25519_crpyto
--- Solana Transfer (YubiKey Signing) ---
Sender pubkey (from YubiKey): <YOUR_PUBKEY>
Sender balance (testnet): <LAMPORTS>
Recent blockhash (from testnet): <BLOCKHASH>
Recipient pubkey (base58): <ENTER>
Amount (lamports): <ENTER>
Enter User PIN (PW1/PIN2): <PIN>
Local signature verification successful.
Transaction sent and confirmed!
Solana signature: <SIGNATURE>
Signed transaction (base64): <BASE64>
Signature (base58): <SIGNATURE>
pcscd running)sudo apt-get install pcscd opensc gnupg scdaemongpg --card-status or pcsc_scanMIT OR Apache-2.0