Skip to content

Repository files navigation

Patrick Hub 🍀

The Developer Platform for the Bitcoin Economy.

Project Status: In Development License: MIT Hackathon: Stacks Builders Competition

Patrick Hub is an all-in-one monetization platform that lets any developer accept Bitcoin payments in their application as easily as using Stripe. It's powered by Turnkey's embedded wallets for a seamless user experience and Stacks (Bitcoin L2) for fast, low-cost, on-chain settlement.

This project is a submission for the Stacks Builders Competition: Embedded Wallet + sBTC on Turnkey.


🔗 Live Links


✨ The Problem

Bitcoin represents over a trillion dollars in global, decentralized value, yet it remains almost entirely inaccessible to the mainstream digital economy. Accepting Bitcoin payments is plagued by friction for both users (wallets, seed phrases) and developers (blockchain complexity).

🍀 Our Solution: Patrick Hub

Patrick Hub abstracts away 100% of this complexity. We provide developers with a single, elegant toolkit to monetize their applications with sBTC (a 1:1 Bitcoin-backed asset), offering a user experience that is indistinguishable from the best of Web2.

Key Features:

  • Embedded Wallet Onboarding: Frictionless passkey & social login for users via Turnkey. A secure, non-custodial wallet is created automatically in the background.
  • One-Click sBTC Checkouts: A clean, beautiful, and embeddable checkout modal that feels like Stripe but settles on-chain.
  • On-Chain Customer Relationships: Every customer and their transaction history are verifiably stored on the Stacks blockchain, creating a transparent and portable customer relationship.
  • Simple Developer SDKs: Integrate in minutes with our React Hooks and Next.js adapter. We handle the entire transaction lifecycle for you.
  • Three Diverse Live Demos: See Patrick Hub in action across different real-world use cases.

🚀 The Demos: A Central Hub of Possibilities

Our landing page serves as a central hub to explore what's possible with Patrick Hub. Each demo runs on the Stacks testnet and showcases a different monetization model.

  1. 🛍️ Creator Store (Digital Product Checkout)

    • A classic e-commerce flow. Sell a digital good (like an e-book or design asset) with a simple, one-time sBTC payment.
    • Launch Demo ↗
  2. 🔑 NFT Access Pass (Token-Gated Content)

    • A Web3-native use case. Gate exclusive content by minting an on-chain NFT pass for a small sBTC fee, demonstrating smart contract interaction.
    • Launch Demo ↗
  3. ⚡️ Pay-as-you-go API (SaaS Credits)

    • A model for SaaS and AI products. Users can top up their API credits with instant sBTC micro-transactions.
    • Launch Demo ↗

🛠️ Tech Stack & Architecture

  • Frontend & Landing Page: Next.js, React, Tailwind CSS
  • Wallet & Auth: Turnkey (Embedded Wallet Kit & Raw Signing API)
  • Blockchain & Settlement: Stacks (Bitcoin L2), sBTC
  • Core Logic: @stacks/transactions

How It Solves the Stacks Signing Challenge

As Turnkey does not yet offer a native Stacks signer, we built the Turnkey Stacks Signer Adapter to handle the specific signing process required by the Stacks blockchain.

The signing flow is as follows:

  1. Build Unsigned Transaction: An unsigned Stacks transaction is created using @stacks/transactions.
  2. Calculate Signing Hash: We compute the preSignSigHash—the specific hash of the transaction data that Stacks requires to be signed.
  3. Sign with Turnkey: This hash is sent to Turnkey's generic signRawPayload endpoint. We instruct Turnkey not to hash the payload again (HASH_FUNCTION_NO_OP).
  4. Receive Signature: Turnkey returns the raw signature components (r, s, v).
  5. Assemble & Broadcast: The signature is attached to the original unsigned transaction, which is then serialized and broadcast to the Stacks network.

This adapter is the core technical contribution of our project and the foundation for a future, official SDK module.


💻 Getting Started (Local Development)

To run this project locally:

  1. Clone the repository:

    git clone https://github.com/hitakshiA/Patrick_hub
    cd Patrick_hub
  2. Install dependencies:

    npm install
  3. Set up environment variables: Create a .env.local file in the root of the project and add your Turnkey and other necessary credentials:

    # Your Turnkey Organization ID
    NEXT_PUBLIC_ORGANIZATION_ID=...
    
    # Other API keys or variables required for the demos...
  4. Run the development server:

    npm run dev

    Open http://localhost:3000 to see the website.


🔮 Future Vision & The Follow-On Grant

This hackathon project is the foundation for a much larger vision. The Turnkey Stacks Signer Adapter we built is designed to be extracted, polished, and published as a standalone, open-source NPM package.

With the follow-on grant, we will:

  1. Package the Adapter: Create a production-ready, well-documented NPM library (@patrick-hub/turnkey-stacks-adapter).
  2. Expand Features: Add support for all Stacks transaction types, including STX transfers, NFT mints, and arbitrary contract calls.
  3. Create Comprehensive Docs: Build a dedicated documentation site with interactive examples.
  4. Collaborate: Work directly with the Turnkey and Hiro engineering teams to align the adapter with their official SDK roadmaps, with the ultimate goal of merging it into their core offerings.

Our mission is to make building on the Bitcoin economy a solved problem for all developers.


📄 License

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

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages