A CLI tool to analyze and calculate reputation statistics for Mostro P2P nodes by analyzing public Nostr events.
Mostro Stats provides transparency and trust metrics for Mostro nodes operating on the Nostr network. By analyzing historical trading data published as Nostr events, this tool calculates objective reputation scores based on trading volume, operational longevity, and successful order completion rates.
- Trust Score Calculation: Generates a 0-100 trust score based on multiple factors
- Volume Analysis: Tracks total trading volume in sats and BTC
- Longevity Metrics: Calculates how long a Mostro node has been operational
- Order Statistics: Counts successful trades and calculates average order sizes
- Event Deduplication: Properly handles order state updates to count unique orders
- Flexible Relay Support: Connect to any Nostr relay or multiple relays
- Debug Mode: Detailed event analysis and status distribution tracking
The tool analyzes two types of Nostr events:
- Development Fee Payment Events (kind 8383, z=dev-fee-payment, y=mostro):
- Used to determine when the node started active trading
- The oldest dev fee event marks the instance's first trading activity
- Order Events (kind 38383, z=order):
- Tracks successful trades, volumes, and timestamps
- Only events with s=success status contribute to reputation metrics
The trust score (0-100) is calculated from three weighted factors:
- Age (30 points max): Days active / 365 days
- Volume (40 points max): Total BTC volume / 1 BTC
- Success Count (30 points max): Successful orders / 100 orders
This scoring mechanism incentivizes long-term honest operation over short-term scams.
- Rust 1.70+ and Cargo
- Internet connection to access Nostr relays
git clone https://github.com/MostroP2P/mostro-score.git
cd mostro-score
cargo build --releaseThe binary will be available at target/release/mostro-score
cargo install --path .Analyze a Mostro node by providing its public key (npub or hex format):
mostro-score --pubkey <MOSTRO_PUBKEY>Connect to specific relays (comma-separated):
mostro-score --pubkey <MOSTRO_PUBKEY> --relays wss://relay.mostro.network,wss://relay.damus.ioOptions:
-p, --pubkey <PUBKEY> Mostro Pubkey (npub or hex) to analyze [required]
-r, --relays <RELAYS> Relays to connect to (comma separated)
[default: wss://relay.mostro.network]
-h, --help Print help information
-V, --version Print version information
# Using npub format
mostro-score --pubkey npub1abc...xyz
# Using hex format
mostro-score --pubkey a1b2c3d4e5f6...
# With multiple relays
mostro-score -p npub1abc...xyz -r wss://relay.mostro.network,wss://relay.damus.ioAnalyzing Mostro Node: npub1...
Hex: a1b2c3...
Connected to relays. Fetching history... (this might take a moment)
Fetched 1247 events. Analyzing...
========================================
MOSTRO NODE REPUTATION REPORT
========================================
Node: npub1abc...xyz
----------------------------------------
First Seen: 2024-01-15 10:30:00 UTC
Last Seen: 2026-01-12 14:45:00 UTC
Days Active: 728.2 days
----------------------------------------
Successful Orders: 156
Total Volume: 15,420,000 sats (0.1542 BTC)
Avg Order Size: 98,846 sats
----------------------------------------
TRUST SCORE: 42/100
========================================
Set RUST_LOG for detailed logging:
export RUST_LOG=debug
mostro-score --pubkey <PUBKEY>Create a .env file in the project root:
RUST_LOG=info
DEFAULT_RELAY=wss://relay.mostro.network- Reputation System Specification - Detailed explanation of the reputation system design and formulas
- Protocol Documentation - Mostro event structures and protocol details
- Development Fee Events - Kind 8383 event structure used for calculating instance age
- Basic reputation scoring from order events
- Volume and success rate tracking
- Simple trust score calculation
- Dispute tracking and penalties
- User rating system integration
- JSON output format for API integration
- Real-time monitoring mode
- Historical trend analysis
- Scam detection heuristics
The reputation system makes exit scams economically unfeasible:
- Time Investment: Building a high trust score requires months of legitimate operation
- Volume Requirements: To attract large orders, nodes must first complete many smaller trades
- Sunk Cost: The reputation becomes a valuable asset that takes effort to build
- Economic Incentive: Long-term fee earnings from legitimate operation exceed one-time scam profits
For detailed economic analysis, see specs/reputation_system_v1.md.
This project follows a spec-driven development workflow using spec-kit. Project principles and constraints are ratified in .specify/memory/constitution.md, which requires every feature to go through this gated sequence, with a review gate before moving to the next step:
constitution → specify → clarify → plan → checklist → tasks → analyze → implement → converge
Contributions are welcome! Please:
- Fork the repository
- Read the project constitution before proposing a change
- Create a feature branch and run the sequence above via spec-kit's
/speckit-*commands, in order, rather than editing code directly - Submit a pull request once
/speckit-convergereports a clean result with no new tasks appended (if it appended tasks, repeat/speckit-implement-> review ->/speckit-convergeuntil it does); skipping a step requires a documented justification in the feature's spec directory, per the constitution
This project is licensed under the MIT License. See the LICENSE file for details.
For issues, questions, or contributions, please open an issue on GitHub.
This tool provides statistical analysis based on public Nostr events. Trust scores are indicators and should not be the sole factor in deciding whether to trade with a Mostro node. Always practice safe trading habits and start with small amounts when using new services.