Secura is a decentralized, end-to-end encrypted messaging app built on a Secura Chain. Messages are stored off-chain on IPFS, and only message CIDs and metadata are stored on-chain for privacy and scalability.
- Decentralized Messaging: Send and receive messages using your blockchain account.
- IPFS Storage: Message content is stored on IPFS; only CIDs are stored on-chain.
- Contact List: Sidebar shows all contacts you've chatted with.
- Chat UI: Modern chat interface with message bubbles, timestamps, and contact selection.
- Polkadot.js Extension: Sign in and send messages using your Polkadot.js wallet.
- Local Time Display: Message timestamps are shown in your system's local time.
- CID Safety: CIDs are encoded/decoded safely for Substrate compatibility.
- Node.js and npm
- Polkadot.js browser extension
- Local Substrate node running with the Secura messaging pallet
- Local IPFS node running (
http://127.0.0.1:5001)
-
Clone the repository:
git clone <your-repo-url> cd secura-app/
-
Install dependencies:
npm install
-
Start the app:
npm start
The app will open at http://localhost:3000.
- Select Account: Choose your blockchain account from the dropdown.
- Select Contact: Click a contact in the sidebar to view your chat.
- Send Message: Type your message and press Enter or click Send.
- View Messages: Messages are loaded from IPFS and shown in the chat window.
- Hover Contact: Hover over a contact to see their full address.
src/App.js— Main React component, handles blockchain, IPFS, and UI logic.src/App.css— Basic styling for the chat interface.pallets/messaging/— Substrate pallet for on-chain message metadata.
- IPFS Fetch Failed: Make sure your IPFS daemon is running and accessible at
http://127.0.0.1:5001. - No Accounts: Install and set up the Polkadot.js browser extension.
- Wrong Timestamps: Set the correct
GENESIS_TIMESTAMPinApp.jsto match your chain's genesis block.
- Change Block Time: Edit
BLOCK_TIME_MSinApp.jsif your chain uses a different block time. - Change Genesis Timestamp: Edit
GENESIS_TIMESTAMPinApp.jsto match your chain's genesis block (in ms).
MIT