Skip to content

Eth Global NYC winner ๐Ÿ†. Protocol for P2P swaps based on onchain wire transfer confirmation

Notifications You must be signed in to change notification settings

pvolnov/true-p2p

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

True P2P

Problem: P2P crypto swaps require bank transfer confirmation. This leads to centralization, delays, and errors.

example: swap DAI to USD on Bank of America

Solution: Protocol for P2P swaps based on onchain wire transfer confirmation

How it works

  1. Bob creates a deal to sell DAI.
  2. Alice accepts the deal and freezes Bob's DAI.
  3. Alice sends USD via Zelle.
  4. Alice creates onchain proof of her Zelle transfer.
  5. Alice uses this confirmation to close the deal and take Bob's DAI.

Onchain proof for Bank (Zelle) transfer

The confirmation works with Plaid and the LIT Protocol nodes.

  1. Alice connects Plaid and creates an API key with access to transaction history from the bank.
  2. Alice calls Programmable PKPs action on LIT Protocol with Plaid transactionId and API key (demo.js).
  3. Inside the LitAction, it executes the request on Plaid and verifies that the transaction actually exists in Alice's bank account. (litActionPlaidCheck.js)
  4. The LitAction signs the transaction information using the decentralized signEcdsa().
  5. Alice adds the signed transaction to the "vault" smart contract (plaid-transactions-storage.sol), and now everyone can verify that she actually made the transaction from her bank account.

Cover.png

Step-by-step-swap

  1. Bob creates a deal to sell DAI on p2p-market (createPaymentRequest(...))
  2. Alice accepts the deal and freezes Bob's DAI (confirmPayment(...))
  3. Alice sends USD via Zelle.
  4. Alice creates onchain proof of her Zelle transfer on plaid-transactions-storage (addTransaction(...))
  5. Alice uses this confirmation to close the deal and take Bob's DAI on p2p-market (reservePayment(...))

Main components:

Demo:

Url: https://bos.gg/#/azbang.near/widget/peer2peer

Source

About

Eth Global NYC winner ๐Ÿ†. Protocol for P2P swaps based on onchain wire transfer confirmation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published