| Crates.io | mostro-webtool |
| lib.rs | mostro-webtool |
| version | 0.1.0 |
| created_at | 2025-10-07 17:11:40.303388+00 |
| updated_at | 2025-10-07 17:11:40.303388+00 |
| description | A web-based tool for generating deterministic keys and building Mostro protocol messages. |
| homepage | https://mostro.network |
| repository | https://github.com/MostroP2P/mostro-webtools |
| max_upload_size | |
| id | 1871974 |
| size | 821,280 |

A web-based tool for generating deterministic keys and building Mostro protocol messages with NIP-59 gift wrap encryption.
Mostro Web Tool is a development and testing utility for the Mostro P2P exchange protocol. It provides:
m/44'/1237'/38383'/0)This tool is intended for development, testing, and educational purposes. For production use, integrate these features directly into your Mostro client application.
m/44'/1237'/38383'/0/{index}mostro-core types(message, signature) tuple# Clone the repository
git clone https://github.com/MostroP2P/mostro-webtool.git
cd mostro-webtool
# Build the project
cargo build --release
# Run the server
cargo run --release
The server will start on http://127.0.0.1:3000
http://127.0.0.1:3000 in your browsernew-order, take-sell)POST /api/trade-key
Content-Type: application/json
{
"mnemonic": "your twelve word mnemonic",
"index": 2
}
Response:
{
"index": 2,
"derivation_path": "m/44'/1237'/38383'/0/2",
"public_key": "02a1b2c3...",
"private_key": "a1a2b3c4..."
}
POST /api/build-gift-wrap
Content-Type: application/json
{
"mnemonic": "your mnemonic phrase",
"trade_index": 1,
"mostro_pubkey": "npub1...",
"message_json": "{\"order\":{\"version\":1,\"action\":\"new-order\",...}}"
}
Response:
{
"gift_wrap_event": {
"id": "event_id",
"kind": 1059,
"pubkey": "ephemeral_key",
"content": "encrypted_content",
...
}
}
mostro-webtool/
βββ src/
β βββ main.rs # Entry point, server initialization
β βββ lib.rs # Core logic, routes, key derivation, gift wrap
βββ tests/
β βββ trade_key_api.rs # API endpoint tests
β βββ gift_wrap_test.rs # NIP-59 encryption tests
βββ static/ # Static assets (logo, etc.)
βββ docs/ # Protocol documentation
β βββ protocol/ # Mostro protocol specs
βββ Cargo.toml # Dependencies and metadata
# Type-check only (fast)
cargo check
# Full compilation
cargo build
# Release build (optimized)
cargo build --release
# Run all tests
cargo test
# Run specific test file
cargo test --test gift_wrap_test
# Run with output
cargo test -- --nocapture
# Run linter
cargo clippy
# Format code
cargo fmt
# Check formatting
cargo fmt -- --check
# Enable debug logging
RUST_LOG=mostro_webtool=debug cargo run
# Enable trace logging (very verbose)
RUST_LOG=mostro_webtool=trace cargo run
Mostro uses a specific BIP44 derivation path for key management:
m/44'/1237'/38383'/0/{index}
β β β β β
β β β β ββ Key index
β β β ββββββ Branch (always 0)
β β ββββββββββββββ Mostro account index
β βββββββββββββββββββββ Nostr Coin type (1237)
ββββββββββββββββββββββββββ Purpose (BIP44)
Identity Key (index 0): m/44'/1237'/38383'/0/0
Trade Keys (index β₯ 1): m/44'/1237'/38383'/0/1, m/44'/1237'/38383'/0/2, ...
Standard Mode: Use identity key (index 0) for seal signing to build reputation
Full Privacy Mode: Use trade key for seal signing (no reputation tracking)
Detailed protocol specifications are available in the docs/protocol/ directory.
β οΈ Important Security Notes:
The project includes comprehensive test coverage:
# Run all tests
cargo test
# Gift wrap encryption tests
cargo test --test gift_wrap_test
# API endpoint tests
cargo test --test trade_key_api
Contributions are welcome! Please:
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.
For questions, issues, or feature requests: