Skip to content

BitBase is a decentralized dashboard built on Bitcoin Layer 2 using the Stacks blockchain. It provides users with a simple interface to manage their token balances and transactions, leveraging the security of Bitcoin and the flexibility of Clarity smart contracts.

Notifications You must be signed in to change notification settings

agnes-pro/bitbase

Repository files navigation

BitBase: A Bitcoin Layer 2 Dashboard on Stacks

BitBase is a decentralized application (dApp) that enables users to manage their Bitcoin-based tokens using the Stacks blockchain, providing a sleek dashboard for viewing balances, transferring tokens, and tracking transaction history. Built with Clarity smart contracts and a React-based frontend, BitBase leverages Bitcoin's security while providing flexible features on a Layer 2 solution.


Features

  • View Wallet Balance: Display wallet balances securely using Stacks API.
  • Token Transfers: Execute secure token transfers between wallets via Clarity smart contracts.
  • Transaction History: View recent transaction history and blockchain interactions.

Technology Stack

  • Smart Contract: Clarity for contract logic and token management.
  • Frontend: React.js for a modern and responsive user interface.
  • Blockchain Integration: Stacks.js for interaction between the frontend and the Stacks blockchain.
  • Testing: Jest for automated testing of Clarity contracts.

Getting Started

Prerequisites

Ensure you have the following software installed:

  • Node.js (version 14.x or higher)
  • Stacks CLI for deploying and interacting with Clarity contracts.

Installation Steps

  1. Clone the Repository:

    git clone https://github.com/agnes-pro/bitbase.git
    cd bitbase
  2. Install Dependencies:

    npm install

Usage

1. Smart Contract Deployment:

Deploy the Clarity smart contract to the Stacks blockchain:

stacks deploy contract clarity/token.clar

2. Run the Frontend Locally:

Start the React-based frontend for interacting with the contract:

npm start

You can now access the dashboard locally at http://localhost:3000 to view balances, send tokens, and interact with transactions.


Project Structure

The project is organized as follows:

bitbase/
├── clarity/               # Clarity smart contract code
│   └── token.clar         # Smart contract handling token transfers
├── frontend/              # Frontend code
│   ├── src/               # React components and logic
│   └── public/            # Static assets
├── tests/                 # Unit tests for the smart contract
├── README.md              # Documentation
└── package.json           # Project metadata and dependencies

Development Workflow

Branching Strategy

Follow a feature-based branching strategy for development:

  • main: Production-ready code.
  • feature/*: Development branches for specific features (e.g., feature/smart-contract, feature/frontend-ui).

Commit Messages

Write descriptive commit messages. Example format:

  • feat: added token transfer functionality
  • fix: corrected balance display issue

Pull Requests

Ensure each pull request (PR) includes:

  • A detailed description of the changes.
  • The issue or feature it addresses.
  • Screenshots (if applicable) and testing notes.

Testing

Automated tests are critical for ensuring contract reliability. To run the tests:

npm run test

Tests will cover:

  • Clarity Contract: Unit tests for token transfer, wallet interactions, and error handling.
  • Frontend: Integration tests for user actions (e.g., viewing balances, transferring tokens).

Security

Security is a top priority. The smart contract includes:

  • Transfer Validations: Prevent unauthorized token transfers.
  • Revert on Failures: Safeguard transactions to ensure state consistency.

During development, ensure your keys and sensitive information are not exposed. Use .env files for environment-specific settings and avoid committing them.


Contribution Guidelines

We welcome contributions! Follow these steps to contribute:

  1. Fork the repository.
  2. Create a new branch for your feature:
    git checkout -b feature/your-feature
  3. Implement your changes.
  4. Submit a detailed pull request, explaining your contribution.

Ensure that your code adheres to the project's coding standards and passes all tests before submitting.


License

This project is licensed under the MIT License. See the LICENSE file for details.

MIT License

Copyright (c) 2024 Agnes Umanah

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Contact

For any questions, feel free to reach out via email at tweetsonly7@gmail.com.

About

BitBase is a decentralized dashboard built on Bitcoin Layer 2 using the Stacks blockchain. It provides users with a simple interface to manage their token balances and transactions, leveraging the security of Bitcoin and the flexibility of Clarity smart contracts.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published