Skip to content

Bolt Protocol is a next-generation framework designed to enable near-instant transactions on the Bitcoin network.

License

Notifications You must be signed in to change notification settings

ronoel/bolt-protocol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Bolt Protocol Logo

Bolt Protocol

Bolt Protocol is designed to enable near-instant transactions for SIP-10 assets (tokens on the Stacks blockchain, like sBTC), improving the user experience and secured by the Bitcoin network.

Introduction

Any dApp or wallet on Stacks can integrate Bolt Protocol to enable instant transactions and eliminate the friction of paying transaction fees with STX.

Note: The current version (v1) only supports sBTC. Support for other SIP-10 tokens will be added in future releases.

We also offer a demo dApp on our website for users who want to try it out:

Contact Us

Key Features

  • Instant Transfers: Experience near real-time confirmed transactions.
  • Trustless Verification: Users can independently verify that transactions processed by the operator are valid and have been submitted to the Stacks blockchain.
  • No Separate Gas Token: Fees are paid in the same token being transferred (sBTC), simplifying the user experience—no need to acquire separate STX tokens.
  • Non-Custodial: Users always retain control of their private keys. Funds cannot be moved without the user's signature.
  • Smart Contract: Ensures a controlled environment where Bolt Protocol can quickly verify and process transactions, then persist them on-chain.
  • Operator Model: The protocol utilizes an operator that is responsible for coordinating and finalizing transactions on Stacks.
  • No Channel Required: Unlike other Bitcoin scaling solutions, Bolt Protocol doesn't require users to create channels, improving the user experience.

Architecture

                           |
                           | (1) Deposit sBTC
                           |     into contract
            +--------------v-------------+
            |       Smart Contract       |
            +--------------+-------------+
                           |
                           | (2) & (3) Transfer sBTC
                           v
            +------------------------------+
            |          Operator            |
            | (Processes transactions)     |
            +------------------------------+
                           | (4) Confirm transaction
                           | (5) Submit final transaction
                           v
        +-----------------------------------+
        |         Stacks Blockchain         |
        +-----------------------------------+

Main functions of the Smart Contract (v1)

Contract address on Testnet:

ST3QZNX3CGT6V7PE1PBK17FCRK1TP1AT02W1N0YJF.boltproto-sbtc-rc-1-1-0

Non-Sponsored Functions

These functions must be submitted directly to the Stacks blockchain and require STX for transaction fees.

1. Deposit Funds on Bolt Contract

This function allows users to deposit sBTC into the Bolt Contract. The transaction requires STX for network fees and is processed directly on the Stacks blockchain.

;;   Deposits tokens into a recipients wallet.
;;   Parameters:
;;     amount: uint                   The amount to deposit.
;;     recipient: principal           The recipient wallet.
;;     memo: (optional (buff 34))      Optional memo.
(deposit
    (amount uint)
    (recipient principal)
    (memo (optional (buff 34))))

2. Withdraw Funds from Bolt Contract

This function initiates a withdrawal request with timelock protection. The transaction requires STX for network fees and is processed directly on the Stacks blockchain.

;;   Initiates a withdrawal request with timelock protection.
;;   Parameters:
;;     amount: uint  The amount to request for withdrawal.
(request-withdrawal 
    (amount uint))

Sponsored Functions

These functions are sponsored by the Bolt Protocol operator, allowing users to pay fees in sBTC instead of STX. All sponsored functions must be submitted through the Bolt API.

Note: The minimum fee accepted by the protocol is 10 satoshis.

See example implementation

Transfer Function Matrix

Choose the appropriate function based on the source and destination of your transfer:

From \ To Bolt Wallet Stacks Wallet
Bolt Wallet transfer-bolt-to-bolt transfer-bolt-to-stacks
Stacks Wallet transfer-stacks-to-bolt transfer-stacks-to-stacks

All sponsored functions share the same parameter structure:

;;   Parameters for all sponsored functions:
;;     amount: uint                   The transfer amount.
;;     recipient: principal           The destination wallet.
;;     memo: (optional (buff 34))      Optional memo.
;;     fee: uint                      Fee amount in sBTC (min 10 satoshis)
(function-name 
    (amount uint)
    (recipient principal)
    (memo (optional (buff 34)))
    (fee uint))

Function descriptions:

  • transfer-bolt-to-bolt: Transfer between Bolt Protocol wallets
  • transfer-bolt-to-stacks: Transfer from Bolt Protocol to Stacks wallet
  • transfer-stacks-to-bolt: Deposit from Stacks wallet to Bolt Protocol
  • transfer-stacks-to-stacks: Direct transfer between Stacks wallets

Bolt API (v1)

Get Wallet Balance

Retrieves the balance information for a specific wallet address and token.

GET /api/v1/wallet/:address/:token/balance

Example:

GET https://boltproto.org/api/v1/wallet/ST3QZNX3CGT6V7PE1PBK17FCRK1TP1AT02W1N0YJF/sbtc-token/balance

Response:

{
    "address": "<address>",
    "balance": "1000000"
}

Get Transaction History

Retrieves transaction history for a specific wallet address and token.

GET /api/v1/wallet/:address/:token/transactions/sbtc-token

Example:

GET https://boltproto.org/api/v1/wallet/ST3QZNX3CGT6V7PE1PBK17FCRK1TP1AT02W1N0YJF/sbtc-token/transactions

Response:

{
    "items": [
        {
            "txId": "faac8c81f79a7740341861dc689b03809145c3756450881018c8fa4859fe8495",
            "token": "sbtc-token",
            "amount": "1000000",
            "fee": "10",
            "sender": "ST3QZNX3CGT6V7PE1PBK17FCRK1TP1AT02W1N0YJF",
            "recipient": "ST3QZNX3CGT6V7PE1PBK17FCRK1TP1AT02W1N0YJF",
            "functionName": "transfer-bolt-to-stacks",
            "timestamp": {}
        }
    ],
    "totalItems": 1,
    "totalPages": 1,
    "currentPage": 1
}

The response includes pagination details and a list of transaction items with the following fields:

  • txId: The transaction identifier- token: The token type (currently only "sbtc-token")
  • amount: Transaction amount in satoshis
  • fee: Fee amount in satoshis
  • sender: The sending wallet address
  • recipient: The receiving wallet address
  • functionName: The smart contract function used
  • timestamp: Transaction timestamp

Submit Transaction

Submits a serialized transaction to the Bolt Protocol.

POST /api/v1/transaction/sbtc-token

Request Body:

{
    "serializedTx": "<serializedTx>"
}

Response:

{
        "txid": "5bed517eb7b58082d39df49240b75f1246584cd56a1b1af69c64295b86334291"
}

Network Availability

Bolt Protocol is currently operational on Testnet. Mainnet support is coming soon.

About

Bolt Protocol is a next-generation framework designed to enable near-instant transactions on the Bitcoin network.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published