Overview
FusionX is a fully decentralized, adminless social platform powered by a single immutable smart contract deployed on FusionLayer. There are no servers, no databases, no admins, and no off-chain dependencies. Every action — account registration, posting, commenting, reacting, following, profile management — is executed directly on-chain.
- Permanent — content lives in FusionLayer state, forever.
- Permissionless — anyone with a wallet and a little FXL can participate.
- Censorship-resistant — no one can delete or moderate your content; only authors can hide their own posts.
- Indexer-free — the UI reads everything straight from the contract via deterministic IDs. No Graph, no backend.
- Live — the app watches the chain block by block: new posts are announced with a "N new posts" banner, and platform stats update automatically.
- Your feed, your rules — an optional "Following only" filter shows just the accounts you follow.
0x13e4b3fE79388C6eF206481655c8557320811104
— view on FusionScan
Built-in Wallet
FusionX ships with an in-app web wallet — no MetaMask or browser extension required.
How it works
- Create — a fresh key pair is generated locally in your browser. You are shown the private key and recovery phrase once and must confirm you saved them.
- Import — paste an existing private key to use a wallet you already own.
- Encryption — the key is encrypted with your password using the standard Ethereum keystore format (scrypt + AES) and stored only in your browser's localStorage. It never leaves your device.
- Sessions — after unlocking, the wallet stays unlocked for the browser tab, so you are not asked for your password on every interaction. Logout locks the wallet again; the encrypted keystore remains so you can unlock it later by entering just your password.
- Send / Receive — the Wallet page lets you transfer FXL and shows your live balance, which is also visible in the top bar. The balance refreshes automatically (every few seconds, after every transaction, and whenever you return to the tab).
FusionLayer Chain
| Setting | Value |
|---|---|
| Network Name | FusionLayer |
| Chain ID | 5070 |
| Currency | FXL |
| RPC URL | https://rpc.fusionlayer.org/ |
| Alternative RPC | https://rpc.fusionscan.net/ |
| Explorer | https://fusionscan.net/ |
Custom RPC endpoints
By default the app uses the official endpoints above (with automatic failover). In
Settings → Network RPC you can point the entire app — reads, transactions, balance,
live updates — at any endpoint you like, including your own node or a local one
(e.g. http://localhost:8545). No wallet or account is needed to change it.
- Custom RPCs are saved on your device and can be added or removed at any time.
- Each endpoint is health-checked before use (reachability, chain ID, latest block, latency).
- If an endpoint reports a different chain ID you are warned before switching.
- One click resets back to the official endpoints.
Prefer using your own wallet app? You can also add FusionLayer to MetaMask via fusionlayer.org/metamask — the contract is a normal EVM contract and can be used from any wallet.
Architecture
The entire platform is two things:
- One smart contract (
SocialMedia) holding all state: users, posts, reposts, comments, reactions, and follows. - A static web UI (this site) that talks to the contract over JSON-RPC. Reads use a public RPC endpoint; writes are signed locally by the built-in wallet and broadcast to the same endpoint.
Because the frontend is static and the state is on-chain, anyone can host a copy of the UI — or build their own — and the platform keeps working. The contract is the platform.
Safety rails built into the contract
onlyEOA— only externally-owned accounts can interact; other contracts are rejected.- Only authors can edit, hide, or pin their own content. Nobody — including the deployer — has special powers.
- Usernames are unique and case-insensitive (
Aliceandaliceare the same handle).
Data Model
| Entity | Key fields |
|---|---|
| UserBasic | userId, username, accountCreationTime, isRegistered |
| UserProfile | nickname, about, website, location, profilePicture, coverPicture, pinnedPost |
| UserStats | postCount, commentCount, followerCount, followingCount |
| Post | globalPostId, author, authorPostId, postTime, content, counts, isHidden, isRepost, originalPostId, reposterContent |
| Comment | commentId (per post), author, commentTime, comment, counts, isHidden |
- Posts get a global sequential ID (1, 2, 3 …) and a per-author sequential ID.
- Comments are numbered sequentially per post (post 7's comments are 1, 2, 3 …).
- Reposts are regular posts flagged
isRepostwith a pointer to the original and an optional note. - Reactions are one of
like/dislike/ none, one per user per item, freely switchable. - Hiding sets a flag — the content stays in state but read functions return an empty string for hidden items.
Query Patterns (indexer-free)
Sequential IDs make every feed a deterministic loop — no event scanning or indexer needed:
- Home feed — read
getGlobalPostCount(), thengetPost(id)descending. FusionX fetches batches in parallel and streams them in as you scroll. - User feed —
getUserStats(user).postCount, thengetGlobalPostId(user, n)→getPost(id). - Comments —
getPostCommentCount(postId), thengetComment(postId, n). - User comments —
getUserCommentCount(user), thengetUserComment(user, n)which returns a (post, comment) pointer. - Profiles — resolve
getUserAddressByUsername(name)then read basic/profile/stats.
Live updates
A lightweight watcher polls the chain roughly once per block. When
getGlobalPostCount() grows past the newest post in your feed, a
"N new posts — click to show" banner appears; clicking it fetches only the new posts and prepends
them without reloading the feed. Platform stats and the recently-joined list update the same way.
With the Following only filter on, each import is checked against
getIsFollowing(); if nothing matches you're told how many posts were filtered out over
how many blocks. Polling pauses while the tab is hidden and resumes instantly when you return.
Contract API
Write functions
| Function | Purpose |
|---|---|
createAccount(nickname, username) | Register. Username ≥ 5 chars, letters/digits, unique (case-insensitive). |
createPost(content) | Publish a post (markdown supported by the UI). |
createRepost(postId, note) | Repost with an optional note. |
createComment(postId, text) | Comment on a post. |
editPost / editRepost / editComment | Author-only edits. |
hidePost / hideComment | Author-only visibility toggle. |
reactToPost / reactToComment | "like", "dislike" or anything else to clear. |
followUser(user, bool) | Follow / unfollow. |
pinPost(postId) | Pin one of your posts (0 unpins). |
changeUsername / updateNickname / updateAbout / updateWebsite / updateLocation / updateProfilePicture / updateCoverPicture | Profile management. |
Read functions
getTotalUsers, getGlobalPostCount, getPost, getComment, getPostCommentCount, getUserBasic,
getUserProfile, getUserStats, getUserAddressByUsername, getUserAddressById, getGlobalPostId,
getUserComment, getUserCommentCount, getUserReactionOnPost, getUserReactionOnComment, getIsFollowing,
isUserRegistered, getHasCommentedOnPost, getHasRepostedAPost
All reads are free; all writes cost a small amount of FXL gas.