Skip to content

cryptoflops/bns-profile-registry

Repository files navigation

Stacks BNS Profile Registry 🛡️

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.

Features

  • 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.

Smart Contract

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)
    }
)

Public Functions

  • update-profile (bio, website, avatar-url): Create or update the caller's profile.

Read-Only Functions

  • get-profile (user): Retrieve profile data for any principal.

Getting Started

Prerequisites

Installation

git clone https://github.com/YOUR_USERNAME/bns-profile-registry.git
cd bns-profile-registry

Running Tests

npm install
npm test

Deployment

To deploy to Mainnet or Testnet, configure your mnemonic in settings/Mainnet.toml (or Testnet.toml) and run:

clarinet deployments apply --mainnet

Security

Sensitive 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.

License

MIT

About

Decentralized on-chain metadata registry for Stacks BNS identities

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors