stellar-deprecated / stellar-client

INACTIVE. Browser based client for stellard. This repository is inactive. It points to the stellard network, which is being replaced by stellar-core. Please refer to the replacement repository, interstellar-client, which points to the stellar-core network.
Other
305 stars 75 forks source link

Bitcoin Bridge #753

Open jedmccaleb opened 10 years ago

deckar01 commented 9 years ago

Original implementation:

  1. A user enters a bitcoin address into the send destination.
  2. The send destination is recognized as a valid bitcoin address.
  3. The destination is federated as {bitcoin address}@{bridge url}.
  4. The federation request will return:
    • quote_url - The URL of the bridge API.
    • quote_destination - The requested federated bitcoin address.
    • _[{extrafields}] - The fields included in the quote request.
  5. A request is made to “quote_url” with:
    • type - “quote”
    • amount - The amount of bitcoin to send.
    • destination - The federated bitcoin address.
    • address - The sender’s stellar address.
    • _[{extrafields}] - Fields from federation results.
  6. The quote request will return:
    • send - The array of accepted amounts.
    • address - The stellar address of the bridge.
    • bitcoin_amount - The amount of bitcoins that can be sent.
    • [destinationTag] - The destination tag.
    • [invoiceId] - The 256bit identifier for the payment.
  7. The payment is made to the bridge’s address for the quoted amount.
  8. The bridge identifies the validated payment transaction by “destinationTag” or “invoiceId”

Resources:

Bridge config example Bitcoin address detection Federation must require quote Quote request Send payment for quote Dummy API implementation Limit and instructions?

Alternative implementation:

Instead of shoehorning the “quote_url” into the federation API, we could add it to the stellartxt file like the “federation_url” is.

  1. A user enters a bitcoin address into the send destination and the amount of btc to send.
  2. The send destination is recognized as a valid bitcoin address.
  3. Get the “quote_url” from the bitcoin bridge’s stellartxt file.
  4. A request is made to “quote_url” with:
    • type - “quote”
    • amount - The amount of bitcoin to send.
    • destination - The federated bitcoin address.
    • address - The sender’s stellar address.
  5. The quote request will return:
    • send - The array of accepted amounts.
    • address - The stellar address of the bridge.
    • bitcoin_amount - The amount of bitcoins that can be sent.
    • [destinationTag] - The destination tag.
    • [invoiceId] - The 256bit identifier for the payment.
  6. The payment is made to the bridge’s address for the quoted amount.
  7. The bridge identifies the validated payment transaction by “destinationTag” or “invoiceId”
deckar01 commented 9 years ago

Some of the original progress integrating bitcoin address handling into the send form can be found in https://github.com/stellar/stellar-client/compare/bitcoin-bridge.