Current Context
Currently, the Mostro mobile application has a hardcoded pubkey for a test Mostro node. As the ecosystem grows, different communities are consolidating their own Mostro nodes, so we need to allow users to select between multiple Mostro instances and optionally add custom nodes.
Objective
Implement a Mostro selection system that allows users to choose between pre-configured Mostro nodes from consolidated communities, while also enabling advanced users to add custom Mostro nodes with appropriate risk warnings.
Proposed Solution
-
Replace single hardcoded pubkey with array of hardcoded pubkeys
- Define a curated list of trusted Mostro nodes from established communities
- This list will be maintained in the app codebase
-
Implement dual selection mechanism:
- Primary UI: Dropdown/selector showing verified Mostro nodes from the hardcoded list
- Secondary option: "Add custom Mostro" button/option for manual pubkey entry
-
Fetch profile metadata (NIP-01 kind 0):
- On app startup, fetch kind 0 event for each hardcoded Mostro pubkey
- For custom added Mostros, fetch kind 0 after user provides pubkey
- Extract
name and picture from profile
- Display this information in the selector for visual identification
-
Custom Mostro addition with risk warning:
- Provide UI for users to input a custom Mostro pubkey
- Before saving, display a warning modal/dialog explaining the risks
- Warning should inform users that unverified nodes may be malicious or unreliable
- Require explicit user confirmation to proceed
-
Selection and custom nodes persistence:
- Save the user's selected Mostro
- Persist custom added Mostros separately from hardcoded list
- Restore both selection and custom nodes in subsequent sessions
Technical Details
Suggested data structure:
interface MostroNode {
pubkey: string;
name?: string; // Obtained from kind 0
picture?: string; // Obtained from kind 0
description?: string; // Optional, from kind 0
relays?: string[]; // Relays to listen for this Mostro
isDefault?: boolean;
isTrusted: boolean; // true for hardcoded, false for custom
addedAt?: number; // timestamp for custom nodes
}
// Hardcoded list in app
const TRUSTED_MOSTRO_NODES: string[] = [
"pubkey1...", // Test Mostro
"pubkey2...", // Community A Mostro
"pubkey3...", // Community B Mostro
];
Flow on app startup:
- Load hardcoded list of trusted Mostros
- Load custom Mostros from local storage
- For each pubkey (trusted + custom), fetch kind 0 from Nostr relays
- Populate UI with name + picture (thumbnail) for each Mostro
- Visually distinguish trusted vs custom nodes in the UI
- If no kind 0 exists, display truncated pubkey as fallback
Custom Mostro addition flow:
- User clicks "Add custom Mostro" option
- User inputs pubkey (with validation for correct format)
- App attempts to fetch kind 0 for preview
- Display warning modal with risk disclaimer
- User confirms or cancels
- If confirmed, add to custom nodes list and persist
Acceptance Criteria
UI/UX Suggestions
Trusted nodes display:
- Show with a "verified" or "trusted" indicator
- Group at the top of the selection list
Custom nodes display:
- Show with a "custom" or "unverified" indicator
- Optionally allow users to remove custom nodes
- Consider showing when the node was added
Risk warning content (suggested):
Warning: Adding Custom Mostro Node
You are about to add a Mostro node that is not verified by the Mostro development team.
Risks:
- The node operator could be malicious
- Trades may not be honored
- Your privacy could be compromised
- The node may be unreliable or offline
Only add custom nodes if you trust the operator or are running your own node.
Do you want to proceed?
[Cancel] [I Understand, Add Node]
Additional Considerations
- Relays: Where to search for kind 0? Specific relays per Mostro or common relays?
- Validation: How to validate that a pubkey is actually an operational Mostro node before adding?
- Node health: Consider displaying status/health for both trusted and custom nodes
- Onboarding: For new users, which Mostro from the hardcoded list will be the default?
- Updates: How will new trusted nodes be added to the hardcoded list? (app updates only?)
- Custom node management: Should users be able to edit/remove custom nodes after adding?
- Export/Import: Consider allowing users to export/import their custom node list
References
Current Context
Currently, the Mostro mobile application has a hardcoded pubkey for a test Mostro node. As the ecosystem grows, different communities are consolidating their own Mostro nodes, so we need to allow users to select between multiple Mostro instances and optionally add custom nodes.
Objective
Implement a Mostro selection system that allows users to choose between pre-configured Mostro nodes from consolidated communities, while also enabling advanced users to add custom Mostro nodes with appropriate risk warnings.
Proposed Solution
Replace single hardcoded pubkey with array of hardcoded pubkeys
Implement dual selection mechanism:
Fetch profile metadata (NIP-01 kind 0):
nameandpicturefrom profileCustom Mostro addition with risk warning:
Selection and custom nodes persistence:
Technical Details
Suggested data structure:
Flow on app startup:
Custom Mostro addition flow:
Acceptance Criteria
nameandpictureof each Mostro are displayed in the selectorUI/UX Suggestions
Trusted nodes display:
Custom nodes display:
Risk warning content (suggested):
Additional Considerations
References