kaccy

Crates.iokaccy
lib.rskaccy
version0.1.0
created_at2026-01-18 23:03:32.761369+00
updated_at2026-01-18 23:03:32.761369+00
descriptionKaccy Protocol - Complete platform for fractional Bitcoin transactions (meta crate)
homepagehttps://github.com/cool-japan/kaccy
repositoryhttps://github.com/cool-japan/kaccy
max_upload_size
id2053272
size173,133
KitaSan (cool-japan)

documentation

https://docs.rs/kaccy

README

kaccy

Meta-crate for the Kaccy Protocol - Complete platform for fractional Bitcoin transactions.

Overview

This is a convenience meta-crate that re-exports all Kaccy sub-crates, allowing you to use the entire Kaccy ecosystem through a single dependency.

Installation

Add this to your Cargo.toml:

[dependencies]
kaccy = "0.1.0"

Usage

Using the Prelude

The easiest way to get started:

use kaccy::prelude::*;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // All common types are available
    let pool = create_pool(&std::env::var("DATABASE_URL")?).await?;
    let user_repo = UserRepository::new(pool.clone());

    Ok(())
}

Using Individual Crates

Access specific crate functionality:

use kaccy::kaccy_core::pricing::LinearBondingCurve;
use kaccy::kaccy_bitcoin::BitcoinClient;
use kaccy::kaccy_reputation::ReputationEngine;
use kaccy::kaccy_ai::AiEvaluator;

What's Included

This meta-crate includes all Kaccy components:

  • kaccy-core - Core business logic (tokens, orders, matching, bonding curves)
  • kaccy-db - Database layer (PostgreSQL, Redis, caching, repositories)
  • kaccy-bitcoin - Bitcoin integration (Core RPC, HD wallets, Lightning, UTXO management)
  • kaccy-reputation - Reputation system (scoring, tiers, SBT, commitments)
  • kaccy-ai - AI services (code evaluation, fraud detection, verification)
  • kaccy-api - REST API (Axum web server, authentication, endpoints)

Individual Crate Installation

If you only need specific components, you can install them individually:

[dependencies]
kaccy-core = "0.1.0"
kaccy-db = "0.1.0"
kaccy-bitcoin = "0.1.0"
kaccy-reputation = "0.1.0"
kaccy-ai = "0.1.0"
kaccy-api = "0.1.0"

Documentation

Individual crate documentation:

Quick Start Example

use kaccy::prelude::*;
use rust_decimal_macros::dec;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Setup database
    let pool = create_pool(&std::env::var("DATABASE_URL")?).await?;

    // Create repositories
    let user_repo = UserRepository::new(pool.clone());
    let token_repo = TokenRepository::new(pool.clone());

    // Initialize Bitcoin client
    let bitcoin_client = kaccy::kaccy_bitcoin::BitcoinClient::new(
        "http://localhost:8332",
        "rpcuser",
        "rpcpassword",
    )?;

    // Create HD wallet for address generation
    let wallet = kaccy::kaccy_bitcoin::HdWallet::new(
        &std::env::var("WALLET_XPUB")?
    )?;

    // Initialize reputation engine
    let reputation = kaccy::kaccy_reputation::ReputationEngine::new(pool.clone());

    // Use bonding curve for pricing
    let curve = LinearBondingCurve::new(
        dec!(0.0001),  // Initial price
        dec!(0.00001), // Increment
    );

    let cost = curve.buy_price(dec!(0), dec!(10));
    println!("Cost for 10 tokens: {} BTC", cost);

    Ok(())
}

Features

All features from sub-crates are available:

  • Token creation and trading
  • Bonding curve pricing
  • Bitcoin payment monitoring
  • Lightning Network support
  • Reputation scoring and tiers
  • AI-powered evaluation
  • REST API with WebSocket
  • Multi-signature wallets
  • Database operations with caching

Requirements

  • Rust 1.85+
  • PostgreSQL 15+
  • Bitcoin Core (for Bitcoin integration)
  • Redis (optional, for caching)

Environment Variables

# Database
DATABASE_URL=postgresql://user:password@localhost/kaccy

# Bitcoin
BITCOIN_RPC_URL=http://localhost:8332
BITCOIN_RPC_USER=rpcuser
BITCOIN_RPC_PASSWORD=rpcpassword
WALLET_XPUB=xpub...

# API
JWT_SECRET=your-secret-key
PORT=8080

# AI Services (optional)
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
GEMINI_API_KEY=...

License

Proprietary - All rights reserved

Support

Commit count: 1

cargo fmt