Thank you for your interest in contributing to Stylus Hardware Anchor! This document provides guidelines for contributing to the project.
If you find a bug, please open an issue with:
- Clear title describing the issue
- Steps to reproduce the problem
- Expected vs. actual behavior
- Environment details (OS, Rust version, firmware version)
- Relevant logs or error messages
We welcome feature suggestions! Please:
- Check existing issues first to avoid duplicates
- Clearly describe the use case and benefits
- Explain how it fits with Stylus Hardware Anchor's vision
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes following our coding standards (see below)
- Test thoroughly - all tests must pass
- Commit with clear messages (
git commit -m 'Add amazing feature') - Push to your fork (
git push origin feature/amazing-feature) - Open a Pull Request with a detailed description
- Format: All Rust code must pass
cargo fmt - Lint: Code must pass
cargo clippywith no warnings - Test: Include unit tests for new functionality
- Documentation: Add doc comments for public functions
# Before submitting, run:
cargo fmt
cargo clippy -- -D warnings
cargo test- Style: Follow PEP 8 guidelines
- Format: Use
blackfor formatting - Type hints: Include type annotations where applicable
- Documentation: Add docstrings for functions and classes
# Before submitting, run:
black .
pylint your_file.py- Format: Follow PlatformIO standards
- Security: Never hardcode secrets or private keys
- Testing: Verify on actual hardware before submitting
- Documentation: Comment critical cryptographic operations
- Never commit private keys,
.envfiles, or secrets - Review dependencies for known vulnerabilities
- Use constant-time operations for cryptographic comparisons
- Report security issues privately (see SECURITY.md)
- All public functions must have unit tests
- Test both success and failure cases
- Verify gas usage remains reasonable
- Test on actual ESP32-S3 hardware
- Verify Keccak-256 output matches test vectors
- Test counter overflow/replay scenarios
- End-to-end receipt generation and verification
- Test against deployed testnet contracts
- Verify all error cases
Use conventional commits:
type(scope): short description
Longer description if needed
Fixes #123
Types:
feat: New featurefix: Bug fixdocs: Documentation changestest: Adding testsrefactor: Code refactoringchore: Maintenance tasks
Example:
feat(verifier): Add batch receipt verification
Implements optimized batch verification for multiple receipts
in a single transaction, reducing gas costs by ~40%.
Closes #42
- Rust 1.93.0 or later
- Python 3.8+
- PlatformIO Core
- ESP32-S3 development board
# Clone the repository
git clone https://github.com/your-org/stylus-hardware-anchor.git
cd stylus-hardware-anchor
# Install Rust dependencies
cargo build
# Install Python dependencies
pip install -r requirements.txt
# Build firmware
cd ohr_firmware
pio run- Be respectful and professional
- Collaborate constructively with other contributors
- Focus on the technical merits of contributions
- Welcome newcomers and help them learn
If you have questions about contributing:
- Open a GitHub Discussion
- Join our Discord (if applicable)
- Email: arhant6armate@gmail.com
Thank you for contributing to Stylus Hardware Anchor! 🚀