Skip to content

sub-level/basement-program-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Basement Logo

🧱 Basement Core

A browser-layer social protocol that turns every webpage into a multiplayer experience

License: Apache-2.0 Anchor Solana

🌍 What is Basement?

Basement is a revolutionary social protocol that transforms every webpage into a living, breathing community space. Instead of sharing links and jumping to Discord or X to discuss, Basement brings the conversation directly to the content you care about.

Core Features

  • 🧡 Threaded Social Layer: Every webpage has its own Basement β€” a space where users can start threads, react, and discuss in-context
  • πŸ€– AI Gremlins: Context-aware agents that summarize pages, surface key threads, and ask smart follow-ups
  • πŸ’° Reward Pools: Threads can carry reward pools in $BASEMENT tokens for top contributors
  • πŸ† Basement Score: A persistent identity and reputation system tied to your contributions across the web
  • 🏒 Brand Ownership: Pages can be claimed by brands to moderate discussions and deploy branded AI Gremlins
  • πŸšͺ Basement Portal: Central hub for purchasing $BASEMENT, viewing scores, and exploring trending spaces

πŸ—οΈ Architecture

Basement Core consists of a Solana program built with Anchor that provides the foundational smart contract infrastructure for the Basement protocol.

Program Structure

basement-core/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ lib.rs              # Main program entry point
β”‚   β”œβ”€β”€ state.rs            # Program state definitions
β”‚   └── instructions/       # Program instructions
β”‚       β”œβ”€β”€ initialize_basement_v0.rs
β”‚       β”œβ”€β”€ use_tokens_for_action_v0.rs
β”‚       β”œβ”€β”€ mint_tokens_v0.rs
β”‚       └── update_basement_config_v0.rs

Core Instructions

  • initialize_basement: Sets up the initial Basement state with token mint and authorities
  • use_tokens_for_action: Allows users to spend $BASEMENT tokens for social actions (comment, thread, boost, graffiti)
  • mint_tokens: Mints new $BASEMENT tokens to specified recipients
  • update_basement_config: Updates program authorities and configuration

State Management

The program maintains a BasementStateV0 account that stores:

  • Token Mint: The $BASEMENT token mint address
  • Mint Authority: Authority to mint new tokens
  • Action Authority: Authority to approve token spending actions
  • Update Authority: Authority to update program configuration

πŸš€ Quick Start

Prerequisites

Installation

  1. Clone the repository

    git clone https://github.com/basement-/basement-program-library.git
    cd basement-program-library
  2. Install dependencies

    yarn install
  3. Build Anchor dependencies

    anchor run build-deps

Development

  1. Start local development network

    anchor test --provider.cluster localnet --skip-deploy --skip-local-validator --skip-build
  2. Bootstrap the program

    anchor run bootstrap --provider.cluster localnet

Testing

Run the test suite:

anchor test

πŸ“¦ SDK Usage

The Basement SDK provides TypeScript/JavaScript bindings for interacting with the Basement Core program.

Installation

npm install @basement-core/basement-sdk

Basic Usage

import { init } from "@basement-core/basement-sdk";

// Initialize connection to Basement Core
const basement = await init({
  connection: connection,
  wallet: wallet,
});

// Use tokens for social actions
await basement.useTokensForAction({
  actionType: "comment",
  amount: 1000000, // 1 $BASEMENT token (6 decimals)
});

πŸ”§ Development

Building

# Build all packages
yarn build

# Build in watch mode
yarn watch

# Clean build artifacts
yarn clean

Code Quality

# Format code
yarn lint:fix

# Check formatting
yarn lint

# Rust formatting
cargo fmt

# Rust linting
cargo clippy --all-targets -- -D warnings

Release Management

# Version bump (patch/minor/major)
yarn versionup:patch
yarn versionup:minor
yarn versionup:major

# Publish packages
yarn release

# Publish canary release
yarn release:canary

πŸ›οΈ Governance

Basement Core is designed with a multi-authority governance system:

  • Mint Authority: Controls token supply and distribution
  • Action Authority: Approves token spending for social actions
  • Update Authority: Manages program configuration updates

This structure allows for flexible governance while maintaining security and decentralization.

🀝 Contributing

We welcome contributions from the community! Please see our Contributing Guidelines for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Add tests for new functionality
  5. Ensure all tests pass (anchor test)
  6. Commit your changes (git commit -m 'Add amazing feature')
  7. Push to the branch (git push origin feature/amazing-feature)
  8. Open a Pull Request

πŸ“„ License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

πŸ”— Links

πŸ™ Acknowledgments

  • Built with Anchor framework
  • Powered by Solana blockchain
  • Inspired by the vision of a more connected web

Made with ❀️ by the Basement team

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors