A lightweight, on-chain metadata registry for Stacks identities. This smart contract allows users to attach rich profile data (bio, website, avatar) to their STX address, enabling BNS-integrated applications to display human-readable profiles.
- Decentralized Profiles: Users own and manage their own metadata directly on the Stacks blockchain.
- BNS Optimized: Designed to complement BNS names by providing a standard way to resolve principal-linked metadata.
- Lightweight Logic: Optimized Clarity code for low gas consumption and high reliability.
The core logic is implemented in user-profile.clar. It maintains a simple data map:
(define-map profiles
principal
{
bio: (string-utf8 140),
website: (string-ascii 256),
avatar-url: (string-ascii 256)
}
)update-profile (bio, website, avatar-url): Create or update the caller's profile.
get-profile (user): Retrieve profile data for any principal.
git clone https://github.com/YOUR_USERNAME/bns-profile-registry.git
cd bns-profile-registrynpm install
npm testTo deploy to Mainnet or Testnet, configure your mnemonic in settings/Mainnet.toml (or Testnet.toml) and run:
clarinet deployments apply --mainnetSensitive files such as settings/*.toml (containing mnemonics) are ignored by git to prevent accidental exposure of private keys. Always use clarinet deployments encrypt for additional safety.
MIT