The Developer Platform for the Bitcoin Economy.
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 Website & Demo Hub: patrickhub.xyz ↗
- 5-Minute Demo Video: Watch on YouTube ↗
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).
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.
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.
-
🛍️ 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 ↗
-
🔑 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 ↗
-
⚡️ 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 ↗
- 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
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:
- Build Unsigned Transaction: An unsigned Stacks transaction is created using
@stacks/transactions. - Calculate Signing Hash: We compute the
preSignSigHash—the specific hash of the transaction data that Stacks requires to be signed. - Sign with Turnkey: This hash is sent to Turnkey's generic
signRawPayloadendpoint. We instruct Turnkey not to hash the payload again (HASH_FUNCTION_NO_OP). - Receive Signature: Turnkey returns the raw signature components (
r,s,v). - 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.
To run this project locally:
-
Clone the repository:
git clone https://github.com/hitakshiA/Patrick_hub cd Patrick_hub -
Install dependencies:
npm install
-
Set up environment variables: Create a
.env.localfile 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...
-
Run the development server:
npm run dev
Open http://localhost:3000 to see the website.
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:
- Package the Adapter: Create a production-ready, well-documented NPM library (
@patrick-hub/turnkey-stacks-adapter). - Expand Features: Add support for all Stacks transaction types, including STX transfers, NFT mints, and arbitrary contract calls.
- Create Comprehensive Docs: Build a dedicated documentation site with interactive examples.
- 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.
This project is licensed under the MIT License. See the LICENSE file for details.