Skip to content

Latest commit

 

History

History
35 lines (18 loc) · 3.04 KB

0079.md

File metadata and controls

35 lines (18 loc) · 3.04 KB

BRC-79: Token Exchange Protocol for UTXO-based Overlay Networks

Ty Everett (ty@projectbabbage.com)

Abstract

We propose a peer-to-peer token exchange protocol under which two parties can securely exchange digital tokens (assets) within Bitcoin SV's BRC-22 UTXO-based Overlay Networks.

Motivation

The motivation behind this protocol is the need for an efficient and secure mechanism to exchange different types of tokenized assets on top of overlay networks between two parties in the BSV ecosystem.

Specification

The protocol is initiated when two parties, Alice and Bob, desire to conduct an asset exchange. It assumes that both parties are online. We specify this protocol conceptually, by example:

  1. Offer Initiation: Alice wants to sell 5 apples for 3 USD. She creates a new transaction moving her 5 apples into a new output. This output includes her exchange request, peer-to-peer contact information (such as BRC-33), and the asset ID for the asset she would like to exchange, reflected in a new transaction on the overlay network.

  2. Revocation by the Initiator: If Alice decides to cancel her proposition, she can spend the offer output and move her apples back, retracting the offer.

  3. Offer Acceptance: Bob is looking to purchase 5 apples for his 3 USD. He sees Alice's offer, verifying her offered UTXO(s) are registered on the overlay. Bob creates a new transaction, conditionally signing his USD over to Alice using SIGHASH_SINGLE. He ensures the signature is only valid over all the inputs from both Alice and Bob. The single output which he signs pays himself the 5 apples from Alice's inputs.

  4. Offer Presentation: Bob contacts Alice, identifies himself and shares the transaction and signature with her.

  5. Verification: Alice verifies the information and conducts due diligence to confirm Bob's outpoints on the overlay network. She verifies the signature and the validity of the transaction. If she decides not to proceed, she can simply do nothing or send Bob a rejection message.

  6. Transaction Settlement: Alice responds by signing her inputs with a SIGHASH_ALL signature, spending her inputs, and adding an output that pays her Bob's 3 USD. She adds her signature to the transaction, and broadcasts it to Bob and the overlay network. Once her transaction reaches the overlay network, Alice now possesses Bob's 3 USD and Bob is the owner of Alice's 5 apples.

Implementation

This Token Exchange Protocol can be implemented on any UTXO-based overlay network adhering to BRC-59, BRC-45, BRC-22 and BRC-24. This protocol has security built-in, stipulating both SIGHASH type usage and broadcasting and topical membership verification methods.

Future work

In general, overlay network recovery mechanisms for uncooperative participant handling (non-registration or improper broadcast of transactions) need to be defined as part of future specifications. Further tooling and guidance for developers would expand adoption.