Skip to content

Commit ced94ee

Browse files
committed
docs: add comprehensive documentation and project configuration
- Add detailed README with installation instructions - Include usage examples and feature documentation - Add MIT license for open source distribution - Add comprehensive .gitignore for Go projects - Include badges and professional project structure - Document all installation methods and use cases
1 parent 573ac3d commit ced94ee

File tree

3 files changed

+328
-0
lines changed

3 files changed

+328
-0
lines changed

.gitignore

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
sol-sign
8+
sol-sign-*
9+
!sol-sign.rb
10+
11+
# Test binary files
12+
*.test
13+
14+
# Output of the go coverage tool, specifically when used with LiteIDE
15+
*.out
16+
17+
# Dependency directories (remove the comment below to include it)
18+
# vendor/
19+
20+
# Go workspace file
21+
go.work
22+
23+
# Build artifacts
24+
dist/
25+
build/
26+
bin/
27+
28+
# Temporary files
29+
*.tmp
30+
*.temp
31+
temp-*
32+
33+
# OS generated files
34+
.DS_Store
35+
.DS_Store?
36+
._*
37+
.Spotlight-V100
38+
.Trashes
39+
ehthumbs.db
40+
Thumbs.db
41+
42+
# IDE and editor files
43+
.vscode/
44+
.idea/
45+
*.swp
46+
*.swo
47+
*~
48+
49+
# Log files
50+
*.log
51+
52+
# Environment files
53+
.env
54+
.env.local
55+
.env.*.local
56+
57+
# Package files
58+
*.deb
59+
*.rpm
60+
*.pkg
61+
*.tar.gz
62+
*.zip
63+
64+
# Test files (but keep sample files for documentation)
65+
test-keypair-temp-*
66+
temp-message.txt
67+
test-keypair.json
68+
test-message.txt
69+
test-features.sh
70+
71+
# Local documentation and development notes
72+
PRODUCTION_SUMMARY.md
73+
ENHANCED_FEATURES.md
74+
75+
# Secrets and keys (be extra careful)
76+
*.key
77+
*.pem
78+
*.p12
79+
**/secrets/
80+
**/keys/
81+
keypair-*.json
82+
private-key-*
83+
84+
# Coverage reports
85+
coverage.txt
86+
coverage.html
87+
coverage.xml
88+
89+
# Benchmark results
90+
*.bench
91+
92+
# Documentation build artifacts
93+
docs/_build/
94+
site/
95+
96+
# Release artifacts (except for reference)
97+
*.tar.xz
98+
*.sig
99+
checksums.txt
100+
101+
# Local development
102+
local/
103+
scratch/
104+
playground/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Aryamanraj
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
# Sol-Sign
2+
3+
[![Build Status](https://github.com/Aryamanraj/go-sol-sign/workflows/Build%20and%20Release/badge.svg)](https://github.com/Aryamanraj/go-sol-sign/actions)
4+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5+
[![Go Report Card](https://goreportcard.com/badge/github.com/Aryamanraj/go-sol-sign)](https://goreportcard.com/report/github.com/Aryamanraj/go-sol-sign)
6+
7+
A lightweight, secure command-line tool for signing messages using Solana keypairs.
8+
9+
## 🚀 Quick Installation
10+
11+
### Universal Installer (Recommended)
12+
```bash
13+
curl -fsSL https://raw.githubusercontent.com/Aryamanraj/go-sol-sign/main/install.sh | bash
14+
```
15+
16+
### Package Managers
17+
18+
#### Homebrew (macOS/Linux)
19+
```bash
20+
brew tap Aryamanraj/tap
21+
brew install sol-sign
22+
```
23+
24+
#### Ubuntu/Debian
25+
```bash
26+
wget https://github.com/Aryamanraj/go-sol-sign/releases/download/v1.0.0/sol-sign_1.0.0_linux_amd64.deb
27+
sudo dpkg -i sol-sign_1.0.0_linux_amd64.deb
28+
```
29+
30+
#### Arch Linux (AUR)
31+
```bash
32+
yay -S sol-sign
33+
```
34+
35+
#### Fedora/CentOS/RHEL
36+
```bash
37+
wget https://github.com/Aryamanraj/go-sol-sign/releases/download/v1.0.0/sol-sign-1.0.0-1.x86_64.rpm
38+
sudo rpm -i sol-sign-1.0.0-1.x86_64.rpm
39+
```
40+
41+
### Manual Download
42+
Download pre-built binaries from the [releases page](https://github.com/Aryamanraj/go-sol-sign/releases).
43+
44+
## 📖 Usage
45+
46+
### Basic Usage
47+
```bash
48+
sol-sign -keypair <path-to-keypair> -message <message>
49+
```
50+
51+
### Examples
52+
53+
Sign a message with base64 output (default):
54+
```bash
55+
sol-sign -keypair ~/.config/solana/id.json -message "Hello World"
56+
# Output: GY/HTLWHgdOPoxFpTz9X1BpfNJtztRzj0gtUxkS0daX4uuC3/YhubdYbJU1tKNcK3Q3FP7XZ3a3nyVarRObuDA==
57+
```
58+
59+
Sign a message with hex output:
60+
```bash
61+
sol-sign -keypair ./my-keypair.json -message "Authentication token" -format hex
62+
# Output: c373f2e5c6e640209f5457290b784b8a4923e5ca8af31cb6033513375123e2cf7bbab791b6dcf9ff245f361d76637eee182ccd6a23453215e9581bb81bbfe500
63+
```
64+
65+
Enable verbose output:
66+
```bash
67+
sol-sign -keypair ./keypair.json -message "Test" -verbose
68+
```
69+
70+
Show version information:
71+
```bash
72+
sol-sign -version
73+
```
74+
75+
### Command Options
76+
77+
| Option | Description | Default |
78+
|--------|-------------|---------|
79+
| `-keypair` | Path to Solana keypair JSON file | *required* |
80+
| `-message` | Message to sign | *required* |
81+
| `-format` | Output format: `base64` or `hex` | `base64` |
82+
| `-verbose` | Enable verbose output | `false` |
83+
| `-version` | Show version information | `false` |
84+
85+
## 🔧 Building from Source
86+
87+
### Prerequisites
88+
- Go 1.21 or later
89+
90+
### Build
91+
```bash
92+
git clone https://github.com/Aryamanraj/go-sol-sign.git
93+
cd go-sol-sign
94+
go build -o sol-sign
95+
```
96+
97+
### Build for Multiple Platforms
98+
```bash
99+
./build-release.sh
100+
```
101+
102+
### Build Packages
103+
```bash
104+
# Debian package
105+
./packaging/deb/build-deb.sh
106+
107+
# RPM package (requires rpmbuild)
108+
rpmbuild -ba packaging/rpm/sol-sign.spec
109+
```
110+
111+
## 🔑 Keypair Format
112+
113+
Sol-Sign expects Solana keypairs in the standard JSON format (array of 64 bytes), as generated by:
114+
115+
- `solana-keygen new`
116+
- Phantom wallet exports
117+
- Solflare wallet exports
118+
- Other standard Solana tools
119+
120+
Example keypair format:
121+
```json
122+
[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]
123+
```
124+
125+
## 🎯 Use Cases
126+
127+
- **Authentication**: Sign messages to prove ownership of a Solana address
128+
- **Proof of Ownership**: Create cryptographic proofs for digital assets
129+
- **Shell Scripting**: Integrate signing into automated workflows
130+
- **Development & Testing**: Sign test messages during development
131+
- **API Authentication**: Generate signed tokens for API access
132+
133+
## 🛡️ Security Features
134+
135+
-**Ed25519 Cryptography**: Uses the same secure cryptographic standard as Solana
136+
-**Keypair Validation**: Verifies keypair integrity before signing
137+
-**No Network Access**: Works completely offline
138+
-**Minimal Dependencies**: Pure Go implementation with no external dependencies
139+
-**Memory Safety**: Secure handling of private key material
140+
141+
## 🔍 Examples in Practice
142+
143+
### Shell Scripting
144+
```bash
145+
#!/bin/bash
146+
MESSAGE="$(date +%s):auth:$(whoami)"
147+
SIGNATURE=$(sol-sign -keypair ~/.config/solana/id.json -message "$MESSAGE")
148+
echo "Authenticated: $MESSAGE"
149+
echo "Signature: $SIGNATURE"
150+
```
151+
152+
### API Authentication
153+
```bash
154+
# Generate authentication token
155+
TOKEN=$(sol-sign -keypair ~/.config/solana/id.json -message "api:$(date +%s)" -format hex)
156+
curl -H "Authorization: Bearer $TOKEN" https://api.example.com/secure-endpoint
157+
```
158+
159+
### Verification
160+
```bash
161+
# Sign a message
162+
sol-sign -keypair ./keypair.json -message "Hello World" > signature.txt
163+
164+
# The signature can then be verified using Solana's verification tools
165+
```
166+
167+
## 📊 Performance
168+
169+
Sol-Sign is designed for speed and efficiency:
170+
171+
- **Cold Start**: ~2ms for signing
172+
- **Memory Usage**: <5MB peak
173+
- **Binary Size**: ~3MB (statically linked)
174+
- **CPU Usage**: Minimal (single-threaded)
175+
176+
## 🤝 Contributing
177+
178+
Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
179+
180+
### Development Setup
181+
```bash
182+
git clone https://github.com/Aryamanraj/go-sol-sign.git
183+
cd go-sol-sign
184+
go mod tidy
185+
go test ./...
186+
```
187+
188+
## 📝 License
189+
190+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
191+
192+
## 🔗 Links
193+
194+
- [GitHub Repository](https://github.com/Aryamanraj/go-sol-sign)
195+
- [Release Downloads](https://github.com/Aryamanraj/go-sol-sign/releases)
196+
- [Issue Tracker](https://github.com/Aryamanraj/go-sol-sign/issues)
197+
- [Solana Documentation](https://docs.solana.com/)
198+
199+
## 📞 Support
200+
201+
- Create an [issue](https://github.com/Aryamanraj/go-sol-sign/issues) for bug reports or feature requests
202+
- Check existing [discussions](https://github.com/Aryamanraj/go-sol-sign/discussions) for questions
203+
- Read the [FAQ](https://github.com/Aryamanraj/go-sol-sign/wiki/FAQ) for common questions

0 commit comments

Comments
 (0)