PersonaNFT Module
Each persona holds its own name, role, metadata, and can be selectively shown or used across the platform. This system supports both pseudonymity and verifiable realness via zkProofs
The PersonaNFT
smart contract powers the identity layer of OmniSocial by enabling users to create and manage unique personas, each represented as an ERC-721-compliant NFT. These NFTs allow users to maintain separate, reputationally distinct identities (e.g., "DAO Mod", "Artist", "Anonymous Burner") all linked to a single OmniWallet
.
🧬 Contract: PersonaNFT.sol
✅ Standards:
Inherits from
ERC721
,Ownable
, and optionallyERC721Enumerable
if indexed querying is needed.
📦 Metadata Schema (on-chain or IPFS)
{
"name": "anonmod.omni",
"description": "Anonymous Moderator Persona",
"image": "ipfs://Qm...imagehash",
"attributes": [
{ "trait_type": "Role", "value": "Moderator" },
{ "trait_type": "Visibility", "value": "Pseudonymous" },
{ "trait_type": "Created", "value": "2025-04-15" }
]
}
🔧 Key Functions
createPersona(string calldata handle, string calldata label, string calldata metadataURI) external returns (uint256)
Purpose: Mints a new persona for the caller.
Validation: Requires handle to be unique.
Effect: Links the persona to caller’s
OmniWallet
, emitsPersonaCreated
.
linkPersona(uint256 personaId) external
Purpose: Associates a minted persona with the sender’s active wallet.
Precondition: Caller must own the
PersonaNFT
.
unlinkPersona(uint256 personaId) external
Purpose: Detaches a persona from the wallet.
Notes: Persona remains in the wallet but becomes inactive.
getActivePersona(address wallet) public view returns (uint256)
Purpose: Returns the active persona ID for a given wallet address.
setMetadataURI(uint256 tokenId, string calldata newURI) external onlyOwner
Purpose: Allows owner to update persona metadata.
🔁 Events
PersonaCreated(address indexed owner, uint256 indexed personaId, string handle)
PersonaLinked(address indexed wallet, uint256 indexed personaId)
PersonaUnlinked(address indexed wallet, uint256 indexed personaId)
🔐 Identity Integrity
One active persona at a time per wallet, but unlimited can be held.
Persona changes update feed display name and
.omni
alias accordingly..omni
name is derived from the primary persona handle (e.g.,anonmod.omni
).Support for zk-based proof binding (e.g., PoH, BrightID) as optional metadata extensions.
🧭 Typical Flow
User signs up and mints first persona via
createPersona
.PersonaNFT
is linked automatically to their wallet.User switches persona using the frontend, triggering
switchPersona(personaId)
via the wallet.UI reflects new persona handle, avatar, and
.omni
domain in posts and actions.
Last updated
Was this helpful?