wallet-encrypt-decrypt
Encrypt and decrypt messages using BSV keys and ECDH. Uses @bsv/sdk for cryptographic operations.
When & Why to Use This Skill
This Claude skill enables secure message handling through BSV (Bitcoin SV) blockchain cryptography. By leveraging the @bsv/sdk and Elliptic Curve Diffie-Hellman (ECDH) protocols, it allows users to encrypt messages for specific public keys and decrypt them using private keys, ensuring robust end-to-end encrypted communication and data privacy within the BSV ecosystem.
Use Cases
- Secure Communication: Facilitating private messaging between BSV wallet addresses where only the holder of the corresponding private key can access the content.
- Data Privacy in Blockchain Apps: Encrypting sensitive user information or metadata before storing it on-chain or in external databases to maintain confidentiality.
- Identity and Access Management: Using cryptographic keys to verify identities and exchange secrets securely between decentralized applications (dApps).
- Automated Secure Workflows: Integrating into automated scripts to handle sensitive transaction details or credentials using industry-standard AES encryption derived from shared secrets.
| name | wallet-encrypt-decrypt |
|---|---|
| description | Encrypt and decrypt messages using BSV keys and ECDH. Uses @bsv/sdk for cryptographic operations. |
| allowed-tools | "Bash(bun:*)" |
Wallet Encrypt/Decrypt
Encrypt and decrypt messages using BSV keys (ECDH).
When to Use
- Encrypt messages to a public key
- Decrypt messages with private key
- Secure communication between BSV addresses
- End-to-end encrypted messaging
Usage
# Encrypt message to public key
bun run /path/to/skills/wallet-encrypt-decrypt/scripts/encrypt-message.ts <public-key> "message"
# Decrypt message with private key
bun run /path/to/skills/wallet-encrypt-decrypt/scripts/decrypt-message.ts <private-wif> <encrypted-hex>
Encryption Method
Uses ECDH (Elliptic Curve Diffie-Hellman):
- Sender: Ephemeral key + recipient public key = shared secret
- Encrypt with AES using shared secret
- Send: ephemeral public key + encrypted data
- Recipient: private key + ephemeral public key = same shared secret
- Decrypt with AES
Requirements
@bsv/sdkpackage for ECDH and AES- Valid BSV public/private keys