Thank you for your interest in contributing to Alien Gateway — a privacy-preserving username and payment resolution layer built on Stellar.
This guide covers everything you need to get started: setting up your environment, branching strategy, commit standards, and the PR process.
- Prerequisites
- Forking & Cloning
- Project Structure
- Branching Strategy
- Making Changes
- Running Tests
- Commit Standards
- Pull Request Process
- Syncing Your Fork
- Best Practices
Before contributing, make sure you have the following installed:
| Tool | Purpose | Version |
|---|---|---|
| Rust | Soroban smart contracts | >=1.78 (stable) |
| Stellar CLI | Deploy and interact with Soroban contracts | latest |
| Node.js | ZK circuit tooling | >=18 |
| Circom | ZK circuit compilation | >=2.1 |
| snarkjs | Proof generation and verification | >=0.7 |
rustup target add wasm32-unknown-unknowncargo install --locked stellar-cli --features optcd zk
npm install-
Fork the repository on GitHub via the "Fork" button on the top right.
-
Clone your fork locally:
git clone https://github.com/<your-username>/Alien-Gateway.git
cd Alien-Gateway- Add the upstream remote to keep your fork in sync:
git remote add upstream https://github.com/Alien-Protocol/Alien-Gateway.git- Verify your remotes:
git remote -v
# origin https://github.com/<your-username>/Alien-Gateway.git (fetch)
# origin https://github.com/<your-username>/Alien-Gateway.git (push)
# upstream https://github.com/Alien-Protocol/Alien-Gateway.git (fetch)
# upstream https://github.com/Alien-Protocol/Alien-Gateway.git (push)Alien-Gateway/
├── gateway-contract/ # Soroban smart contracts (Rust)
│ ├── contracts/
│ │ └── alien-gateway/
│ │ └── src/
│ │ ├── lib.rs # Entry point
│ │ ├── contract_core.rs # Core contract logic
│ │ └── address_manager.rs # Username → address mapping
│ ├── tests/
│ │ └── integration/ # Integration tests
│ └── Cargo.toml
│
└── zk/ # Zero-knowledge circuits (Circom)
├── circuits/
│ ├── merkle/ # Merkle inclusion & path circuits
│ ├── username_hash.circom
│ └── hello.circom
├── scripts/ # Compile & trusted setup scripts
└── package.json
Always create a new branch from an up-to-date main. Use the following prefixes to keep branches organized:
| Prefix | Use for |
|---|---|
feat/ |
New features |
fix/ |
Bug fixes |
docs/ |
Documentation changes |
refactor/ |
Code refactoring (no behavior change) |
test/ |
Adding or improving tests |
chore/ |
Tooling, CI, dependency updates |
Examples:
git checkout -b feat/merkle-root-anchoring
git checkout -b fix/address-lookup-panic
git checkout -b docs/contributing-guideKeep branch names lowercase, hyphen-separated, and descriptive.
- Sync your fork before starting (see Syncing Your Fork).
- Create a branch following the naming conventions above.
- Make focused, atomic changes — one feature or fix per branch.
- Test your changes locally before committing (see Running Tests).
Run the full test suite from the gateway-contract directory:
cd gateway-contract
cargo testRun only integration tests:
cargo test --test integrationBuild the contract WASM (used for deployment verification):
cargo build --target wasm32-unknown-unknown --releaseCompile a circuit:
cd zk
# On Unix/macOS:
bash scripts/compile.sh
# On Windows:
scripts/compile.cmdRun the trusted setup:
# On Unix/macOS:
bash scripts/trusted-setup.sh
# On Windows:
scripts/trusted-setup.cmdThis project follows the Conventional Commits specification.
<type>(<scope>): <short description>
[optional body]
[optional footer]
| Type | When to use |
|---|---|
feat |
A new feature |
fix |
A bug fix |
docs |
Documentation changes only |
refactor |
Code change that neither fixes a bug nor adds a feature |
test |
Adding or correcting tests |
chore |
Build process, dependency updates, tooling |
perf |
Performance improvement |
feat(contract): add merkle root anchoring to registry
fix(address-manager): resolve panic on empty username lookup
docs: add contributing guide for new contributors
test(integration): add tests for username collision handling
refactor(zk): simplify poseidon hasher circuit inputsRules:
- Use the imperative mood in the subject line ("add" not "added" or "adds")
- Limit the subject line to 72 characters
- Do not end the subject line with a period
- Reference related issues in the footer:
Closes #21
- Push your branch to your fork:
git push origin feat/your-feature-name-
Open a PR against
Alien-Protocol/Alien-Gateway'smainbranch on GitHub. -
Link the PR to its issue using a closing keyword in the PR description:
Closes #21
-
Fill out the PR description with:
- What changed and why
- Any relevant context or trade-offs
- Steps to test or verify the change
-
Ensure all checks pass before requesting a review.
-
Be responsive to reviewer feedback — address comments and push updates to the same branch.
-
Do not force-push after a review has started unless asked.
A PR will be merged when:
- It passes CI checks
- It has at least one maintainer approval
- All reviewer comments are resolved
Keep your fork up to date with upstream before starting any new work:
git fetch upstream
git checkout main
git merge upstream/main
git push origin mainIf you have a feature branch in progress:
git checkout feat/your-feature-name
git rebase mainResolve any conflicts, then continue your work.
- One PR = one thing. Don't mix unrelated changes in the same pull request.
- Write clear PR descriptions. Explain the problem, your solution, and how to verify it.
- Keep commits clean. Squash WIP commits before opening a PR if they don't add meaningful history.
- Test before pushing. Run
cargo testfor contracts and verify ZK circuits compile before submitting. - Ask questions early. If you're unsure about scope or approach, open a draft PR or comment on the issue before investing significant time.
- Respect existing conventions. Match the code style, module organization, and naming patterns already in the codebase.
- Security-first. This project handles financial transactions and ZK proofs. Be especially careful with input validation, arithmetic, and any on-chain state mutation.
If you have questions not covered here, open a GitHub Discussion or comment on the relevant issue.
Happy building! 🚀