| Crates.io | yubikey-crpyto |
| lib.rs | yubikey-crpyto |
| version | 0.1.2 |
| created_at | 2025-05-16 04:36:03.418937+00 |
| updated_at | 2025-05-16 04:36:03.418937+00 |
| description | YubiKey OpenPGP card signing for Ed25519 and secp256k1 based crypto signatures |
| homepage | |
| repository | https://github.com/stars-labs/cypto-rust-tools |
| max_upload_size | |
| id | 1676075 |
| size | 246,537 |
yubikey_ed25519_crpyto)A Rust library and CLI example for constructing and signing Solana transactions using a YubiKey's OpenPGP card (Ed25519), and etherum secp256k1 keys. This library allows you to securely sign Solana and eth transactions using your YubiKey, leveraging its cryptographic capabilities to ensure private key security.
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