DEV Community

flat cash
flat cash

Posted on

Explainer: BearerSwap — how private crypto transfers work

Explainer: BearerSwap – How Private Crypto Transfers Work

In the world of blockchain, transparency is a double-edged sword. While the public ledger ensures accountability and immutability, it also means that every transaction, every balance, and every wallet address is visible for anyone to see. This lack of privacy can be a significant hurdle for individuals and institutions who require discretion in their financial dealings. BearerSwap, a feature of the FLAT Protocol, offers a solution by enabling private crypto transfers that mimic the anonymity of physical cash.

The Problem: Public by Default

Imagine every time you paid for something with cash, a public record was created, detailing your identity, the amount, and who you paid. This is, in essence, how most blockchain transactions work. While pseudonymous, linking a wallet address to an individual or entity can often be achieved through various analytical techniques. This inherent transparency, while foundational to blockchain's integrity, can compromise financial privacy.

The Concept: Bearer Instruments

Bearer instruments are financial tools that, like physical cash, transfer value without a public record of ownership change. The person in possession of the instrument is presumed to be the owner. BearerSwap leverages this concept to allow for transfers where the sender and recipient are not directly linked on the public blockchain.

How BearerSwap Works: Commit-Reveal and Hash-Locked Transfers

BearerSwap facilitates private transfers through a clever combination of cryptographic techniques:

  • Commit-Reveal Scheme: The core of BearerSwap lies in a commit-reveal scheme. When a user initiates a private transfer, they first "commit" to the transaction by sending funds to a smart contract. This commitment includes a cryptographic hash of a secret value (the "preimage") and the recipient's address. Importantly, the secret preimage itself is not revealed at this stage.
  • Hash-Locked Transfers: The funds are then "hash-locked" within the contract, meaning they can only be unlocked by someone who knows the original secret preimage that matches the committed hash.
  • Relayer and Gas Stipend: To ensure the recipient can claim the funds privately, a "relayer" is involved. The sender provides a "gas stipend" to the relayer. The relayer then pays the gas fees for the recipient to claim the funds, further obscuring the link between the original sender and the recipient.
  • Reveal Phase: The sender privately communicates the secret preimage to the recipient (e.g., off-chain via a secure messaging app). The recipient then uses this preimage to "reveal" the transaction to the smart contract, proving they know the secret and unlocking the funds.

In simple terms, think of it like this: You lock a package (your crypto) in a secure locker (the smart contract) and tell someone a secret code (the preimage) to unlock it. The locker knows the correct code because you gave it a "fingerprint" (the hash) of that code beforehand. A helpful friend (the relayer) pays the small fee to open the locker so no one knows it was you who put the package in or your friend who opened it.

Supported Tokens

BearerSwap natively supports private transfers for several tokens within the FLAT Protocol ecosystem, including:

  • ETH
  • FLAT
  • SAVE
  • RISE

This means users can conduct private transactions with these specific digital assets.

The Privacy Model: Unlinked on-chain

The primary privacy benefit of BearerSwap is that the sender and recipient are not directly linked on the public blockchain. The funds move from the sender to a smart contract, and then from the smart contract to the recipient, with the relayer facilitating the final step. This breaks the direct, traceable link that typically exists in public blockchain transactions.

Limitations

While BearerSwap offers a significant step forward in blockchain privacy, it's important to acknow

Top comments (0)