Thank you for your interest in contributing to the KhodPay Wallet Libraries! We welcome contributions from the community.
- Rust 1.70 or higher
- Git
- Familiarity with cryptocurrency wallet concepts (BIP32, BIP39)
-
Fork and clone the repository:
git clone https://github.com/YOUR_USERNAME/khodpay-wallet.git cd khodpay-wallet -
Build the project:
cargo build
-
Run the tests:
cargo test -
Run the benchmarks:
cargo bench
If you find a bug, please create an issue with:
- A clear, descriptive title
- Steps to reproduce the issue
- Expected behavior
- Actual behavior
- Your environment (OS, Rust version, etc.)
- Any relevant code snippets or error messages
We welcome feature requests! Please create an issue with:
- A clear, descriptive title
- Detailed description of the proposed feature
- Use cases and benefits
- Any relevant examples or mockups
-
Create a new branch:
git checkout -b feature/your-feature-name
-
Make your changes:
- Follow the existing code style
- Add tests for new functionality
- Update documentation as needed
- Ensure all tests pass
-
Commit your changes:
git commit -m "Add feature: description of your changes"Follow conventional commit format:
feat:for new featuresfix:for bug fixesdocs:for documentation changestest:for test additions or changesrefactor:for code refactoringperf:for performance improvementschore:for maintenance tasks
-
Push to your fork:
git push origin feature/your-feature-name
-
Create a Pull Request on GitHub
- Follow Rust's official style guidelines
- Run
cargo fmtbefore committing - Run
cargo clippyand address all warnings - Keep functions focused and well-documented
- Write unit tests for all new functionality
- Ensure existing tests still pass
- Add integration tests for complex features
- Update doc tests in code documentation
- Aim for high test coverage
- Add doc comments for all public APIs
- Include usage examples in doc comments
- Update README files when adding features
- Keep documentation clear and concise
DO NOT open a public issue for security vulnerabilities.
Instead, please email security@khodpay.com with:
- Description of the vulnerability
- Steps to reproduce
- Potential impact
- Suggested fix (if any)
When contributing code that handles sensitive data:
- Never log or print sensitive information (seeds, private keys, mnemonics)
- Use
zeroizefor sensitive data in memory - Avoid unsafe code
- Follow cryptographic best practices
- Validate all inputs
- Handle errors appropriately
# Run all tests
cargo test
# Run tests with output
cargo test -- --nocapture
# Run specific crate tests
cargo test -p khodpay-bip39
cargo test -p khodpay-bip32
# Run doc tests
cargo test --doc
# Run integration tests
cargo test --test '*'- Test both success and error cases
- Use descriptive test names
- Test edge cases
- Validate against official test vectors when available
- Keep tests focused and isolated
# Run all benchmarks
cargo bench
# Run specific benchmark
cargo bench --bench benchmarks- Profile before optimizing
- Benchmark significant changes
- Document performance characteristics
- Avoid premature optimization
- Consider both speed and memory usage
# Build and open documentation
cargo doc --open --no-deps
# Build documentation for all crates
cargo doc --workspace- Use clear, concise language
- Include code examples
- Document all public APIs
- Explain complex algorithms
- Link to relevant specifications (BIP32, BIP39, etc.)
-
Automated Checks: All PRs must pass CI/CD checks:
- Tests must pass
- Code must compile without warnings
- Formatting must be correct
- Clippy must pass
-
Code Review: Maintainers will review your PR:
- Code quality and style
- Test coverage
- Documentation
- Security considerations
-
Feedback: Address any requested changes
-
Merge: Once approved, your PR will be merged
Before submitting a PR, ensure:
- Code builds without errors or warnings
- All tests pass (
cargo test) - Code is formatted (
cargo fmt) - Clippy passes without warnings (
cargo clippy) - New functionality has tests
- Documentation is updated
- CHANGELOG.md is updated (if applicable)
- Commit messages follow conventions
- PR description explains changes clearly
We especially welcome contributions in these areas:
- Additional language support for BIP39
- Performance improvements
- Additional test coverage
- Documentation improvements
- Bug fixes
- Examples and tutorials
- Integration with other standards (BIP44, BIP49, BIP84)
- WASM support
- Hardware wallet integration examples
- Issues: Use GitHub issues for bugs and feature requests
- Discussions: Use GitHub discussions for questions and general discussion
- Email: contact@khodpay.com for other inquiries
By contributing to this project, you agree that your contributions will be dual-licensed under MIT and Apache-2.0, matching the project's license.
Contributors will be recognized in:
- CHANGELOG.md for significant contributions
- Release notes
- Project documentation
Thank you for contributing to the KhodPay Wallet Libraries! 🚀