Skip to content

Commit c29182d

Browse files
Merge pull request #136 from StabilityNexus/docs/contributing-maintainers-agents
Docs/contributing maintainers agents
2 parents d32a0fa + aba16aa commit c29182d

11 files changed

Lines changed: 685 additions & 3 deletions

CONTRIBUTING.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Contributing to MiniChain
2+
3+
Thanks for your interest in contributing to MiniChain! This document explains how to get involved, from discussing an idea to getting a pull request merged.
4+
5+
## Before You Start: Discuss It First
6+
7+
**Every contribution — bug fix, feature, or refactor — should be discussed before you start writing code.** This avoids duplicate work and makes sure the change fits the project's minimality-first philosophy.
8+
9+
1. Join the [Stability Nexus Discord server](https://discord.gg/YzDKeEfWtS).
10+
2. Discuss your issue, bug, or feature idea in the project's channel/thread: [MiniChain discussion](https://discord.com/channels/995968619034984528/1471163521877410045).
11+
3. If it's a confirmed bug or an agreed-upon feature, open a matching GitHub Issue in this repository describing the problem and the proposed approach.
12+
13+
Only after that discussion should you start implementation — this is the first and most important rule below.
14+
15+
## Contribution Checklist
16+
17+
- 🔴 **MUST** — Discuss non-trivial changes in Discord (see above) or in a GitHub Issue before opening a PR.
18+
- 🔴 **MUST** — Follow the module layout and architecture constraints described in [agent.md](agent.md) (one concern per module under `minichain/`, state changes go through `state.py`, etc.).
19+
- 🔴 **MUST** — Add or update tests under `tests/` for any new or changed behavior.
20+
- 🔴 **MUST** — Run `pytest` locally and confirm it passes before opening a PR.
21+
- 🔴 **MUST** — Sign off every commit per the [Developer Certificate of Origin](DCO.md).
22+
- 🟡 **SHOULD** — Keep PRs focused on a single logical change; split unrelated changes into separate PRs.
23+
- 🟡 **SHOULD** — Update relevant docs ([README.md](README.md), [agent.md](agent.md), [brand/Brand.md](brand/Brand.md)) when behavior, commands, or conventions change.
24+
- 🟡 **SHOULD** — Check `pytest --cov=minichain` to make sure coverage on touched modules doesn't regress.
25+
- 🔵 **SUGGESTED** — Link the Discord discussion or GitHub Issue in your PR description for context.
26+
- 🔵 **SUGGESTED** — Prefer small, incremental PRs over large ones when the change can reasonably be split.
27+
28+
## How to Contribute
29+
30+
1. **Discuss** the change in Discord or a GitHub Issue (see above).
31+
2. **Fork** the repository and create a branch off `main`.
32+
3. **Install dependencies:**
33+
```bash
34+
pip install -r requirements.txt -r requirements-test.txt
35+
```
36+
4. **Make your changes**, following the conventions in [agent.md](agent.md).
37+
5. **Test:**
38+
```bash
39+
pytest
40+
```
41+
6. **Sign off your commits** per the [DCO](DCO.md) (`git commit -s`).
42+
7. **Add yourself** to [Contributors.md](Contributors.md) if you aren't listed yet.
43+
8. **Open a pull request** against `main`, describing the problem and the fix, and linking back to the Discord discussion or issue.
44+
45+
## Getting Help
46+
47+
- Ask questions in the [Stability Nexus Discord](https://discord.gg/YzDKeEfWtS).
48+
- Please do not contact contributors directly — keep discussion in Discord or GitHub Issues so it stays public and searchable.
49+
50+
All contributions to this project are made under the terms of the [Developer Certificate of Origin](DCO.md). See [Contributors.md](Contributors.md) for the list of people who have contributed.

Contributors.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
This file contains information about people who contribute to this project.
22

33
Please do not contact these people directly.
4-
Instead, join our [Discord](https://discord.gg/fuuWX4AbJt) and communicate about
5-
this project in the [TODO channel](TODO).
4+
Instead, join our [Discord](https://discord.gg/YzDKeEfWtS) and communicate about
5+
this project in the [MiniChain channel](https://discord.com/channels/995968619034984528/1471163521877410045).
66

77
## Contributors
88

@@ -12,4 +12,4 @@ are made under the terms of the [Developer Certificate of Origin](DCO.md).
1212
| Name | Github Username | Discord Username | Email Address |
1313
| -------------------------------- | ------------------ | ------------------ | ---------------------------- |
1414
| Bruno Woltzenlogel Paleo | @Zahnentferner | @b.wp | zahnentferner@gmail.com |
15-
| TODO | TODO | TODO | TODO |
15+
| Siddhant | @siddhant | @siddhantcookie | siddhantkk27@gmail.com |

SECURITY.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
MiniChain is released via tagged versions (`vX.Y.Z`, [SemVer](https://semver.org)), built and published automatically by [.github/workflows/release.yml](.github/workflows/release.yml) whenever a matching tag is pushed. While the project is pre-1.0 (currently `0.1.0-beta`), only the latest tagged release and `main` receive security fixes — older tags are not backported to.
6+
7+
| Version | Supported |
8+
| ---------------- | -------------------- |
9+
| Latest tagged release ||
10+
| `main` (unreleased) ||
11+
| Older tagged releases ||
12+
13+
## Reporting a Vulnerability
14+
15+
**Please do not open a public GitHub Issue for security vulnerabilities.** Publicly disclosing a vulnerability before it's fixed can put users at risk.
16+
17+
Instead, report it privately using one of these channels:
18+
19+
1. **GitHub Private Vulnerability Reporting** (preferred): open a report using the "Security" tab on the [MiniChain repository](https://github.com/StabilityNexus/MiniChain/security/advisories/new).
20+
2. **Discord DM:** send a direct message to one of the maintainers listed in [docs/maintainer.md](docs/maintainer.md)— do not post details in a public channel.
21+
22+
Please include as much of the following as you can:
23+
24+
- A description of the vulnerability and its potential impact.
25+
- Steps to reproduce it (proof-of-concept code, a malicious contract, a crafted P2P message, etc.).
26+
- The affected file(s)/module(s), if known.
27+
- Any suggested fix or mitigation.
28+
29+
## What to Expect
30+
31+
- We aim to acknowledge new reports within **14 days**.
32+
- We'll work with you to understand and validate the issue, and will keep you updated as a fix is developed.
33+
- Once a fix is released, we'll credit you in the release notes/changelog unless you'd prefer to remain anonymous.
34+
35+
## Scope
36+
37+
Given MiniChain's goals — education, research, and innovation on a minimal blockchain — vulnerabilities of particular interest include:
38+
39+
- Transaction signature forgery or verification bypass (see `minichain/transaction.py`).
40+
- Smart contract sandbox escape or gas-metering bypass (see `minichain/contract.py`).
41+
- Consensus/fork-choice manipulation or state root corruption (see `minichain/chain.py`, `minichain/state.py`, `minichain/pow.py`).
42+
- P2P protocol issues that allow a peer to crash, partition, or deny service to a node (see `minichain/p2p.py`).
43+
- JSON-RPC issues that allow unauthorized access to node data or funds (see `minichain/rpc.py`).
44+
45+
Out of scope: issues in vendor third-party binaries (`bore_bin/`, `bore.zip`) should be reported upstream to their respective projects.
46+
47+
## Questions
48+
49+
For non-security questions, use the [Stability Nexus Discord](https://discord.gg/YzDKeEfWtS) or open a regular GitHub Issue, per [CONTRIBUTING.md](CONTRIBUTING.md).

agent.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# AGENTS.md
2+
3+
## Project Stack
4+
5+
Python 3.10+, no web framework. Core libs: `pynacl` (Ed25519 signing), `trie` (Merkle Patricia Trie state), `libp2p`/`multiaddr` (P2P networking), `aiohttp` (JSON-RPC server). Tests: `pytest`, `pytest-asyncio`, `pytest-cov`.
6+
7+
## Build and Test Commands
8+
9+
- Install: `pip install -r requirements.txt -r requirements-test.txt`
10+
- Run all tests: `pytest`
11+
- Run with coverage: `pytest --cov=minichain`
12+
- Run a single test file: `pytest tests/test_chain.py`
13+
- Run a node locally: `python main.py --port 9000 --datadir ./node1_data`
14+
15+
## Code Style Conventions
16+
17+
- Core blockchain logic lives under `minichain/` as one module per concern (`block.py`, `chain.py`, `state.py`, `p2p.py`, `mempool.py`, `pow.py`, `rpc.py`, `persistence.py`, `contract.py`). Add new functionality to the matching module rather than creating a new top-level file for a small feature.
18+
- Smart contracts run under `sys.settrace` for gas metering and `multiprocessing` for sandboxing (see `contract.py`). Any change to contract execution must preserve both the gas-per-opcode accounting and the process-level sandbox boundary.
19+
- Tests mirror module names 1:1 (`minichain/chain.py` -> `tests/test_core.py` or a dedicated `tests/test_<feature>.py`). Follow the existing file when extending coverage for a module rather than adding a new ad-hoc test file.
20+
21+
## Architecture Constraints
22+
23+
- `state.py` owns the Merkle Patricia Trie state root; block validation and contract execution must go through it rather than mutating account balances directly.
24+
- `p2p.py` implements the fork-choice rule for chain sync — new consensus-affecting logic belongs in `chain.py`/`pow.py`, not duplicated in the networking layer.
25+
- `rpc.py` exposes read/write JSON-RPC 2.0 methods (`mc_*`) on port 8545; keep new RPC methods consistent with that naming prefix.
26+
27+
## Boundaries
28+
29+
- Never modify `genesis.json` or files under a node's `--datadir` (persisted chain/state data) as part of a code change.
30+
- `bore_bin/` and `bore.zip` are vendor binaries — do not edit or regenerate them by hand.
31+
- Don't hand-edit the coverage badge/table in `README.md`; it's generated by CI.
32+
33+
## Git Workflow
34+
35+
- Branch off `main`.
36+
- Open PRs against `main`; describe the problem and the fix, per [CONTRIBUTING.md](CONTRIBUTING.md).
37+
- Sign off commits per the [DCO](DCO.md).

brand/Brand.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# MiniChain Brand Guide
2+
3+
MiniChain is a minimal, fully functional blockchain implemented in Python, built by [Stability Nexus](https://stability.nexus/) with three goals: **education**, **research**, and **innovation**. The brand should read the same way the codebase does — clean, minimal, and unpretentious. No visual noise, no unnecessary ornamentation.
4+
5+
## Logo
6+
7+
MiniChain's mark is a 4D hypercube (tesseract) projected onto 2 dimensions: eight overlapping edge-paths radiating from a central point, each vertex marked with a glowing node. It's meant to evoke a network graph — nodes connected by edges — rather than a literal chain, which fits a project about distributed state rather than links in a chain.
8+
9+
- [`logo.svg`](logo.svg) — the MiniChain mark, 330×330, transparent background. Use this as the primary logo wherever MiniChain is referenced on its own.
10+
- [`org-logo.svg`](org-logo.svg) — the Stability Nexus organization mark, 500×500. Use alongside the MiniChain logo when representing the org/project pairing (as in the [README](../README.md) header), never as a substitute for it.
11+
12+
**Usage rules**
13+
14+
- Keep clear space around the logo equal to at least the radius of one vertex node.
15+
- Do not recolor the gradient — it is the identifying feature of the mark.
16+
- Do not stretch or skew; the projection's proportions are fixed and should scale uniformly.
17+
- Minimum display size: 32px, below which the vertex nodes become illegible.
18+
19+
## Favicons and Icons
20+
21+
- [`favicon.svg`](favicon.svg) — the MiniChain mark, suitable for use as a browser tab icon / site favicon. Reuses the same source as `logo.svg` since the mark is simple enough to stay legible at small sizes without a separate simplified variant.
22+
- For platforms that require raster favicons (`.ico`, PNG sizes like 16×16/32×32/180×180 for Apple touch icons), export from `favicon.svg` at build time rather than hand-maintaining bitmap copies.
23+
24+
## Color Palette
25+
26+
Pulled directly from the logo's gradient and glow layers:
27+
28+
| Swatch | Hex | Role |
29+
| ------ | --- | ---- |
30+
| 🟩 | `#228B22` | Primary — forest green, gradient start |
31+
| 🟢 | `#5A981A` | Primary support — edge glow |
32+
| 🟡 | `#C8B209` | Accent — gradient midpoint |
33+
| 🟠 | `#FFBF00` | Accent — gradient end |
34+
| 🟡 | `#FFC517` | Highlight — gold glow, used as the badge label color in the README |
35+
| 🫒 | `#91A511` | Node fill — vertex points |
36+
37+
**Usage rules**
38+
39+
- `#228B22` is the primary brand color — use it for the dominant accent in any MiniChain-branded surface (badges, links, headings).
40+
- `#FFC517` / `#FFBF00` are gold accents — use sparingly, for highlights and call-to-action elements, not body text or large fills.
41+
- Maintain WCAG AA contrast (4.5:1 for body text) when pairing these colors with text; the greens and golds above are tuned for use on dark or neutral backgrounds, not as text-on-white body copy.
42+
43+
## Typography
44+
45+
MiniChain doesn't currently ship custom web fonts — GitHub-rendered Markdown (README, docs) uses GitHub's default system font stack. For any future site, dashboard, or block explorer built for the project, the recommended pairing is:
46+
47+
- **Headings / UI:** [Space Grotesk](https://fonts.google.com/specimen/Space+Grotesk) — a geometric sans with a slightly technical feel that matches the wireframe logo, without being a generic startup sans.
48+
- **Body text:** [Inter](https://fonts.google.com/specimen/Inter) — high legibility at small sizes, wide language support.
49+
- **Code / addresses / hashes:** [JetBrains Mono](https://www.jetbrains.com/lp/mono/) — monospace, disambiguates `0`/`O` and `1`/`l`/`I`, which matters for public keys, transaction hashes, and CLI output.
50+
51+
Fall back to the system font stack (`-apple-system, Segoe UI, Roboto, sans-serif`) if none of the above are loaded, rather than a generic web-safe serif.
52+
53+
## File Location
54+
55+
All brand assets and this guide live in the [`brand/`](.) folder at the repository root:
56+
57+
```
58+
brand/
59+
├── Brand.md # this file
60+
├── logo.svg # primary MiniChain mark
61+
├── org-logo.svg # Stability Nexus organization mark
62+
└── favicon.svg # favicon-ready MiniChain mark
63+
```

brand/favicon.svg

Lines changed: 84 additions & 0 deletions
Loading

brand/logo.svg

Lines changed: 84 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)