You have a disposal 4 prompts of an LLM. You need to create a complete prompt for each…
- User
You have a disposal 4 prompts of an LLM. You need to create a complete prompt for each of these, giving the instructions to allow to create a complete project. You must subdivide the work between the prompts, giving adeguate context, deciding the roles of the and allowing informations to flow between all of them, to return a congruent, correct and complete code. The project is the following: an e-commerce site running on the Tor network. The site must implement adeguate and complete encryption, privacy and automatic Monero payment measures. Both a complete backend and frontend are required. In particular, the frontend must work both for desktop and mobile devices. The code should be complete, working and secure, updated with the state-of-the-art implementations. Each prompt should be as specific as possible, not leaving decisions free, specifying all the structurs and informations necessary. The code should be in Python.
Assistant
Creating a complete e-commerce site for the Tor network with robust encryption, privacy, and Monero payments is a complex task. Below is a 4-prompt breakdown that ensures modularity, security, and congruency across all components. Each prompt will handle a distinct part of the project while maintaining context flow.
Prompt 1: Backend Infrastructure & Tor Integration
Role: Backend Developer (Tor & Security Specialist)
Objective: Set up a Flask-based backend with Tor integration, secure API endpoints, and Monero payment handling.Instructions:
- Tor Integration:
- Use
stemto run a hidden service (localhost:5000→.onion). - Automate
.onionaddress generation and persistence.
- Use
- Backend Structure:
- Flask app with the following routes:
/api/products(GET: list products)/api/order(POST: encrypted order submission)/api/payment/xmr(POST: Monero payment gateway)
- Flask app with the following routes:
- Encryption:
- Use
libsodium(viaPyNaCl) for end-to-end encryption. - All API requests/responses must be encrypted with a pre-shared key (PSK).
- Use
- Monero Payments:
- Integrate
monero-pythonto generate subaddresses per order. - Automatically verify payments via RPC (
monero-wallet-rpc).
- Integrate
- Database:
- SQLite with
peewee(encrypted at rest using SQLCipher).
- SQLite with
Output:
- Complete Flask backend code.
- Tor hidden service setup script.
- Monero RPC integration.
Prompt 2: Frontend (Desktop & Mobile)
Role: Frontend Developer (Privacy-Focused UI/UX)
Objective: Build a responsive frontend that works over Tor, with encrypted comms and Monero checkout.Instructions:
- Framework:
- Use Svelte (compiled to static files for minimal JS).
- Serve via Flask (
/static).
- Design:
- Dark theme (reduces fingerprinting).
- No external CDNs (all assets local).
- Tor Compatibility:
- Use relative paths (no hardcoded
.onion). - Warn if JavaScript is disabled (Tor Browser).
- Use relative paths (no hardcoded
- Encryption:
- Embed
libsodium.jsfor client-side encryption before API calls.
- Embed
- Monero Checkout:
- QR code generator for XMR payments.
- Poll
/api/payment/xmrfor confirmation.
Output:
- Complete Svelte frontend (HTML/CSS/JS).
- Flask static file serving setup.
Prompt 3: Security & Privacy Hardening
Role: Security Engineer
Objective: Ensure all layers are resistant to deanonymization and exploits.Instructions:
- Backend Hardening:
- Rate-limit API endpoints (
flask-limiter). - Strip all metadata from uploaded images (
Pillow).
- Rate-limit API endpoints (
- Frontend Hardening:
- CSP headers to block inline scripts.
- No cookies or localStorage (sessionless design).
- Tor Best Practices:
- Disable server headers (Flask
after_request). - Randomize request timing to deter traffic analysis.
- Disable server headers (Flask
- Monero Privacy:
- Use subaddresses for each transaction.
- Auto-lock wallet after inactivity.
Output:
- Security middleware for Flask.
- Frontend CSP/config.
- Monero wallet management scripts.
Prompt 4: Deployment & Automation
Role: DevOps Engineer
Objective: Create reproducible, secure deployment scripts.Instructions:
- Dockerization:
Dockerfilewith:- Flask backend.
- Tor daemon.
monero-wallet-rpc.
- CI/CD:
- GitHub Actions to rebuild on commit.
- Server Setup:
docker-compose.ymlwith:- Isolated networks for Tor/Flask/Monero.
- Volume for
.onionpersistence.
- Testing:
- Script to simulate purchases over Tor.
Output:
- Complete Docker setup.
- CI/CD pipeline.
- Test scripts.
Flow Between Prompts
- Prompt 1 → Prompt 2: Shares API specs (endpoints, encryption).
- Prompt 2 → Prompt 3: Provides frontend attack surface for hardening.
- Prompt 3 → Prompt 4: Supplies security configs for deployment.
Each prompt builds on the prior, ensuring a fully working, secure, and private e-commerce site. Let me know if you'd like any prompt expanded!
- Tor Integration:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.