Overview

One-click transactions using any token on any chain.

The Box enables one-click transactions using any token on any chain. Leveraging a set of hooks and embeddable React components, developers can select which action type they would like to perform (discussed further in key concepts), and The Box takes care of the rest. It abstracts bridging and swapping to provide users a seamless transaction experience regardless of where they store their funds, allowing dapps to meet users at their point of liquidity.

Motivation

The Box is critical infrastructure in realizing the promise of a multi-chain future. App chains and rollups boast user experiences capable of onboarding mainstream audiences, but cannot thrive if each new chain further fractures liquidity. The Box makes crypto payments accessible and user-friendly for everyone by meeting users at their point of liquidity. With just one click to transact, regardless of the dapp or underlying network, The Box is the easiest way to transact onchain.


Working with The Box

Developers can implement The Box as:

  1. A React component using: @decent.xyz/the-box
  2. A set of hooks using @decent.xyz/box-hooks

The Box React component is the fastest way to get up and running. It is a headless component that affords a significant degree of customization. We recommend this component for most developers as you don't have to rebuild components like token & network selectors and loading & error modals.

Many developers will prefer to access The Box's routing directly via our set of hooks. To mitigate duplicitous work and expedite Box installations using hooks, we have published two additional libraries:

  1. @decent.xyz/box-ui: un-styled chain and token selector components
  2. @decent.xyz/box-common: set of types most used in The Box

The four packages above all strictly include routing between supported EVM networks to minimize the size and dependencies of the core package. The Box also supports Solana, demonstrated in the "Get DUST" button on the DeGods Season III page. If you are a Solana developer, please specify that you would like beta access to box-solana in your API Request.


Types of Routes

Transactions through The Box typically take one of six possible forms:

Direct Execution

Traditional crypto transactions: the user is connected to the network of the asset with which they are interacting, and the user is paying in a native token.

Example: A collector claims an NFT on Optimism with enough ETH on Optimism to pay for gas.

Swap & Execute

If a user would like to pay for a transaction on the same chain, but pay with a non-native supported token, The Box will execute a swap on behalf of the collector prior to completing the transaction.

Example: A collector would like to use Lido to stake ETH on Ethereum, but elects to pay with USDC instead. The Box will swap USDC for ETH before executing the transaction.

Bridge & Execute

If a user would like to pay for a transaction using funds on a different chain, The Box will execute a bridge on behalf of the collector prior to completing the transaction.

Example: A collector wants to purchase an NFT on Ethereum. She would like to use ETH on Arbitrum even though the NFT is priced in ETH on Ethereum. The Box will bridge ETH from Arbitrum to Ethereum (example) before executing the mint.

Bridge, Swap & Execute

If a user would like to pay for a transaction with a non-native token, on a different source chain, The Box will execute both bridge and swap transactions on behalf of the collector prior to completing the purchase.

Note: The Box automatically fetches the most efficient routes for bridging and swapping. Some transactions require swaps on both the source and destination chains to complete the transaction.

Example: A collector would like to purchase an NFT on Polygon priced in MATIC using ETH on Arbitrum. The Box will bridge ETH from Arbitrum to Polygon, then swap that ETH for MATIC prior to completing the purchase.

Swap

The box natively supports swapping as a service, allowing for easily embeddable DEX support into any website.

Bridge

The box natively supports bridging as a service, allowing users to easily move from any token on any source chain to any destination token on the destination chain.


Audit

The Box's smart contracts successfully underwent two audits from Arbitrary Execution in June 2023. The final audit report was delivered July 5, 2023. You can find the second and final audit report here.

Integration Questions?

If you have any integration questions, reach out anytime and a support dev will help!
email: [email protected], twitter: @decentxyz