Technology
Privacy-First Ephemeral AI: Technical Foundation. WaterstoneAI’s privacy-first model leverages ephemeral AI, encryption, and Web3 to empower users with control over their identity and data across vision, voice, and LLMs. Below is the technical rationale and implementation, tied to our current scalable Flask app and upcoming Web3 roadmap.
Privacy-First Foundation
Why It Works:
​WAI ensures user data (prompts, emotions, metadata) is transient, using ephemeral tokens with a time-to-live (TTL) mechanism. The /delete endpoint allows users to erase data, aligning with privacy rights for vision (e.g., image inputs), voice (e.g., audio commands), and LLMs (e.g., text prompts).
Encryption
Implementation: We use cryptography.fernet for AES-256 encryption of prompts and emotions, ensuring security in transit and at rest. Encrypted metadata is stored in AWS DynamoDB, decryptable only with the session key.
Ephemeral Mode
How:
The expires_at field ensures tokens vanish after 1 hour, mimicking an ephemeral mode. Unlike OpenAI’s persistent browser-based behavior logging, WAI’s /delete endpoint enables user-controlled data resets, limiting tracking of behavioral data (e.g., click patterns).
-
​​Application: Users opt for ephemeral mode, ensuring no residual data persists.
Web3 and Digital Twins
Integration:
The digital_twin.user_id field links tokens to Ethereum-based NFTs, enabling users to own their data in DeFi marketplaces. Ephemeral processing ensures transient data unless explicitly minted.
-
Privacy: Combines Web3 ownership with ephemeral resets for maximum control.
Privacy Process Flowchart
User inputs are encrypted, processed ephemerally, and deleted, ensuring privacy.
from flask import Flask, jsonify, request
from flask_cors import CORS
import uuid
import time
import boto3
from cryptography.fernet import Fernet
app = Flask(__name__)
CORS(app, resources={r"/*": {"origins": "https://*.wixsite.com"}})
tokens = {} # Temporary; use DynamoDB for production
key = Fernet.generate_key() # Encryption key
cipher = Fernet(key)
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table('WaterstoneTokens')
@app.route('/generate', methods=['POST'])
def generate():
try:
data = request.get_json()
if not data or 'prompt' not in data:
return jsonify({"error": "Missing 'prompt'"}), 400
prompt = data.get('prompt')
emotion = data.get('emotion', 'neutral')
user_id = data.get('user_id', f"uid_{uuid.uuid4().hex}")
# Encrypt sensitive data
encrypted_prompt = cipher.encrypt(prompt.encode()).decode()
encrypted_emotion = cipher.encrypt(emotion.encode()).decode()
# AI behavior prediction (placeholder)
reward_score = 0.5 if emotion in ['happy', 'excited'] else 0.2
token_id = f"token_{uuid.uuid4().hex}"
token = {
"id": token_id,
"metadata": {
"encrypted_emotion": encrypted_emotion,
"encrypted_thought": encrypted_prompt,
"created_at": time.time(),
"expires_at": time.time() + 3600, # 1-hour TTL
"switchable": True,
"digital_twin": {"user_id": user_id},
"reward_score": reward_score
},
"value": "Symbiotic Learning Token",
"blockchain": "Ethereum"
}
# Store in DynamoDB with TTL
table.put_item(Item=token)
tokens[token_id] = token # Temporary
return jsonify({"response": f"Token {token_id} created.", "token": token}), 200
except Exception as e:
return jsonify({"error": f"Failed to generate token: {str(e)}"}), 500
@app.route('/delete/<token_id>', methods=['DELETE'])
def delete(token_id):
try:
if token_id not in tokens:
return jsonify({"error": f"Token {token_id} not found"}), 404
table.delete_item(Key={"id": token_id})
del tokens[token_id] # Temporary
return jsonify({"response": f"Token {token_id} deleted, data swiped clean."}), 200
except Exception as e:
return jsonify({"error": f"Failed to delete token: {str(e)}"}), 500
if __name__ == '__main__':
app.run(host='0.0.0.0', port=8080, debug=False)
Our Flask app ensures privacy with encrypted, ephemeral tokens and user-controlled deletion, scalable via DynamoDB and ready for Web3 integration.
Call to Action: Explore Our API | Try the Demo