Native Bitcoin Vault

Overview

The Optimex Vault is a non-custodial escrow mechanism that temporarily holds users' assets while trades are in process. It ensures security, decentralization, and compatibility across multiple blockchains, including Bitcoin, Ethereum, and Solana.

For Bitcoin, Optimex has designed a native Bitcoin vault using existing Bitcoin scripting, making it fully compatible with the Bitcoin network. This vault acts as a non-custodial "smart account", allowing users to manage assets and execute DeFi actions directly on Bitcoin.

Key Features

  • Multisig Authorization: Uses a 2-of-2 multisig, where the two signers are the User and the Optimex Settlement Committee.

  • Timelock Security: If no action is taken within a specified time T, the user can reclaim funds unilaterally.

Vault Functionality

  1. Trade Execution (Within T-Hour Window)

    • User deposits BTC into a Pay To Taproot (P2TR) address controlled by the Vault.

    • A transaction can be authorized using two ECDSA signatures—one from the User and another from the Optimex Settlement Committee.

    • The Settlement Committee utilizes tECDSA (threshold ECDSA), ensuring no single party has full control over the private key.

  2. Timelock Protection (After T-Hour Window)

    • If no trade execution occurs within time T, the user can reclaim their BTC using only their own signature.

    • This ensures that user funds remain secure and cannot be held indefinitely.

Bitcoin Vault Script

In the following, we give more technical details on our implementation of the Bitcoin Vault using Taproot (P2TR).

The Bitcoin Vault is essentially a Script that facilitates conditional BTC custody through a Taproot address. The Taproot output can only be spent through a script spending paths. The key spending path is disabled by using the "Nothing Up My Sleeve" (NUMS) point as internal key. The script spending paths comprise of:

  1. Multi-sig spending Path

<SettlementCommitteePK> OP_CHECKSIG <UserPK> OP_CHECKSIGADD OP_2 OP_NUMEQUAL

Where:

  • SettlementCommitteePKis the Settlement Committee's tECDSA public key

  • UserPK is the User's pubic key

Example transaction that spends the Vault via the Multi-sig spending path can be found here.

  1. User-controlled withdrawal after timelock Path

<TimelockBlocks> OP_CHECKSEQUENCEVERIFY OP_DROP <UserPK> OP_CHECKSIG

Where:

  • TimelockBlocks determines the Vault's expiry time. It is set to 144 blocks which is approximately 24 hours. After this duration has elapsed, the User can close the vault and withdraw the deposit from the vault at their discretion.

  • <UserPK> is the User's pubic key

Example transaction of the user close vault and withdraw after 144 Bitcoin blocks can be found here.

Cross-Chain Vault Instances

Each blockchain Optimex supports has its own Vault instance, designed to meet its security and smart contract capabilities:

  • Bitcoin: Uses Bitcoin Script to enable non-custodial, time-locked asset management.

  • Ethereum & Solana: Implemented as smart contracts, allowing users to deposit assets and specify authorized recipients for trade settlements.

Advantages of Optimex Vaults

  • Security:

    • The combination of standard ECDSA and tECDSA minimizes the risk of key compromise.

    • The Settlement Committee’s tECDSA setup ensures no single entity controls the private key.

    • Users always have a fallback mechanism to reclaim funds after a timeout.

  • Non-Custodial & Decentralized:

    • Users retain control of their assets, even during trades.

    • Transactions require multi-party authorization, ensuring trustless execution.

  • Bitcoin Compatibility:

    • Uses standard Bitcoin Script opcodes, ensuring full compatibility with all Bitcoin nodes, wallets, and services.

    • The tECDSA implementation is invisible to the Bitcoin network, making the Vault seamless and efficient.

Last updated