A lightweight, secure command-line tool for signing messages using Solana keypairs.
curl -fsSL https://raw.githubusercontent.com/Aryamanraj/go-sol-sign/main/install.sh | bashbrew tap Aryamanraj/tap
brew install go-sol-signwget https://github.com/Aryamanraj/go-sol-sign/releases/download/v1.0.0/go-sol-sign_1.0.0_linux_amd64.deb
sudo dpkg -i go-sol-sign_1.0.0_linux_amd64.debyay -S go-sol-signwget https://github.com/Aryamanraj/go-sol-sign/releases/download/v1.0.0/go-sol-sign-1.0.0-1.x86_64.rpm
sudo rpm -i go-sol-sign-1.0.0-1.x86_64.rpmDownload pre-built binaries from the releases page.
go-sol-sign -keypair <path-to-keypair> -message <message>Sign a message with base58 output (default):
go-sol-sign -keypair ~/.config/solana/id.json -message "Hello World"
# Output: KYGBc3hBpYrvF36QP63fDojCwaJjkQXH8s8j1LPA98iW5C2z1hP3YASQfa61U1nPAD42Jks3kURbR1iK1G1dz5USign a message with base64 output:
go-sol-sign -keypair ~/.config/solana/id.json -message "Hello World" -format base64
# Output: GY/HTLWHgdOPoxFpTz9X1BpfNJtztRzj0gtUxkS0daX4uuC3/YhubdYbJU1tKNcK3Q3FP7XZ3a3nyVarRObuDA==Sign a message with hex output:
go-sol-sign -keypair ./my-keypair.json -message "Authentication token" -format hex
# Output: c373f2e5c6e640209f5457290b784b8a4923e5ca8af31cb6033513375123e2cf7bbab791b6dcf9ff245f361d76637eee182ccd6a23453215e9581bb81bbfe500Enable verbose output:
go-sol-sign -keypair ./keypair.json -message "Test" -verboseShow version information:
go-sol-sign -version| Option | Description | Default |
|---|---|---|
-keypair |
Path to Solana keypair JSON file | required |
-message |
Message to sign | required |
-format |
Output format: base58, base64, or hex |
base58 |
-verbose |
Enable verbose output | false |
-version |
Show version information | false |
- Go 1.21 or later
git clone https://github.com/Aryamanraj/go-sol-sign.git
cd go-sol-sign
go build -o go-sol-sign./build-release.shThis project uses automated releases. To create a new release:
# Use the release script (recommended)
./release.sh 1.3.0
# Or manually create a tag (triggers CI/CD)
git tag v1.3.0
git push origin v1.3.0The CI/CD pipeline automatically:
- Updates version numbers in all files
- Builds binaries for all platforms
- Creates GitHub release with assets
- Updates the install script to use the new version
# Debian package
./packaging/deb/build-deb.sh
# RPM package (requires rpmbuild)
rpmbuild -ba packaging/rpm/go-sol-sign.specSol-Sign expects Solana keypairs in the standard JSON format (array of 64 bytes), as generated by:
solana-keygen new- Phantom wallet exports
- Solflare wallet exports
- Other standard Solana tools
Example keypair format:
[174,47,154,16,73,165,8,54,94,126,4,251,181,26,108,167,211,56,139,147,176,18,191,92,252,35,53,78,68,251,187,99,171,162,95,142,64,8,114,17,208,78,147,203,161,78,207,211,172,190,167,68,238,208,147,21,117,112,183,169,13,96,24,228]- Authentication: Sign messages to prove ownership of a Solana address
- Proof of Ownership: Create cryptographic proofs for digital assets
- Shell Scripting: Integrate signing into automated workflows
- Development & Testing: Sign test messages during development
- API Authentication: Generate signed tokens for API access
- β Ed25519 Cryptography: Uses the same secure cryptographic standard as Solana
- β Keypair Validation: Verifies keypair integrity before signing
- β No Network Access: Works completely offline
- β Minimal Dependencies: Pure Go implementation with no external dependencies
- β Memory Safety: Secure handling of private key material
#!/bin/bash
MESSAGE="$(date +%s):auth:$(whoami)"
SIGNATURE=$(sol-sign -keypair ~/.config/solana/id.json -message "$MESSAGE")
echo "Authenticated: $MESSAGE"
echo "Signature: $SIGNATURE"# Generate authentication token
TOKEN=$(sol-sign -keypair ~/.config/solana/id.json -message "api:$(date +%s)" -format hex)
curl -H "Authorization: Bearer $TOKEN" https://api.example.com/secure-endpoint# Sign a message
sol-sign -keypair ./keypair.json -message "Hello World" > signature.txt
# The signature can then be verified using Solana's verification toolsSol-Sign is designed for speed and efficiency:
- Cold Start: ~2ms for signing
- Memory Usage: <5MB peak
- Binary Size: ~3MB (statically linked)
- CPU Usage: Minimal (single-threaded)
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
git clone https://github.com/Aryamanraj/go-sol-sign.git
cd go-sol-sign
go mod tidy
go test ./...We use automated version bumping for releases:
# For bug fixes (1.3.0 -> 1.3.1)
./version-bump.sh patch
# For new features (1.3.0 -> 1.4.0)
./version-bump.sh minor
# For breaking changes (1.3.0 -> 2.0.0)
./version-bump.sh majorSee WORKFLOW.md for detailed development workflow.
This project is licensed under the MIT License - see the LICENSE file for details.
- Create an issue for bug reports or feature requests
- Check existing discussions for questions
- Read the FAQ for common questions