From: Sjors Provoost <sjors@sprovoost.nl>
To: Nicolas Dorier <nicolas.dorier@gmail.com>,
Bitcoin Dev <bitcoin-dev@lists.linuxfoundation.org>
Subject: Re: [bitcoin-dev] BIP Proposal: Crypto Open Exchange Protocol (COX)
Date: Wed, 20 Dec 2017 09:49:09 +0100 [thread overview]
Message-ID: <A2014DA0-F6F8-470F-A167-E66723281269@sprovoost.nl> (raw)
In-Reply-To: <CA+1nnr=-6UkJT=TWjDHhZtXsic8p0fzQ=Yk1tSqkhL+NuvqCQw@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 10378 bytes --]
I think this could be quite useful, although I don’t know if it will get adopted. If any such small local exchanges want to weigh in on this proposal, that would help. Same goes for shopping cart integrators, e.g. the folks writing WooCommerce and Shopify plugins.
Consider adding some requirements around the use of SSL and certificate pinning. Can you refer to the kind of best practices Stripe and PayPal recommend? Should some additional shared-secret or cookie / macaroon based authentication be added?
Can you clarify if this integration can run in a browser, or due to security / privacy constraints must be server-to-server?
Though it’s important to remain future-proof by being flexible, leaving the above details to individual implementers is probably going to result in bad things.
What are your thoughts on rate limiting vs. privacy? Should a payment source never return the same address even if nothing is paid to it? Otherwise someone could just crawl webshops to create an inventory of payment addresses. A new address every page reload could be a DDOS vector. It also wouldn't be compatible with BIP44 because of its gap limit, although I don’t think that’s a huge problem for exchanges.
Can this be combined with an invoice mechanism similar to Lightning, e.g. where the exchange sends a pre-image to the users wallet (relayed via and retained by the web shop) upon receipt of the funds, which they can then present to the merchant in case something went wrong. Exchanges might be happy to support this protocol, but they don’t want the burden of dealing with user support requests, so having signed invoices could help with that.
I would consider a more specific name like Delegated UTXO or something. “Exchange” suggests is more like 0X or Bisq.
Speaking of Bisq, it would be neat if merchants can rely on random peer to peer counterparties to convert to fiat, so their customer information and revenue figures aren’t in the hands of a single counter party. Obviously that’s a can of worms today, but it would be nice if the protocol was able to support that if one day someone figures out the fraud, compliance and bookkeeping stuff.
Finally, why only exchanges? It could make sense fo shopping cart software to talk to a Bitcoin wallet that’s hosted somewhere else for similar reasons. Right now the best these plugins can do is hold on to an XPUB, and I’ve even seen solutions that just send the customers coins to their own backend wallet and then forward it.
Sjors
> Op 20 dec. 2017, om 07:28 heeft Nicolas Dorier via bitcoin-dev <bitcoin-dev@lists.linuxfoundation.org> het volgende geschreven:
>
> Hi everyone,
>
> As some of you know, I am working on a complete open source replacement of Bitpay for allowing merchant to accept cryptocurrency payments while having a way to sell automatically.
>
> A crucial, missing part, is fiat conversion. And I figured out a simple protocol that exchanges (or adapters) can implement to allow any merchant to cash out BTC in fiat while giving them the freedom to choose their own payment processor solution.
>
> This also have positive impact on scalability: Before, a merchant would receive the bitcoin from the customer then would send to the exchange, resulting in two transactions.
> With this specification, it would be one transaction.
>
> Special thanks to anditto and kallewoof for reviewing. I am waiting for your feedback:
>
> Github link: https://github.com/NicolasDorier/bips/blob/master/bip-xxx.mediawiki <https://github.com/NicolasDorier/bips/blob/master/bip-xxx.mediawiki>
>
> <pre>
> BIP: XXX
> Layer: Applications
> Title: Crypto Open Exchange Protocol (COX)
> Author: Nicolas Dorier <nicolas.dorier@gmail.com <mailto:nicolas.dorier@gmail.com>>
> Comments-Summary: No comments yet.
> Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-XXX <https://github.com/bitcoin/bips/wiki/Comments:BIP-XXX>
> Status: Draft
> Type: Standards Track
> Created: 2017-12-20
> License: BSD-3-Clause
> CC0-1.0
> </pre>
>
> ==Abstract==
>
> A simple protocol for decoupling payment processor solutions from exchanges.
>
> ==Motivation==
>
> Cryptocurrency merchant adoption is mainly driven by availability, ease of use and means of acceptance.
> We call such solutions `Payment Processors`.
>
> Until now, payment processing solutions fall into one of the two following categories:
>
> # Self-hosted with the customer paying in cryptocurrency and the merchant receiving it directly.
> # Centralized, coupled with an exchange feature, with the customer paying in cryptocurrency to the merchant, and receiving fiat or cryptocurrency on his exchange account.
>
> The self-hosted solution has two issues:
>
> # The merchant becomes vulnerable to the wild volatility of cryptocurrencies.
> # It is wasteful of blockchain space, if the merchant does not pay suppliers in crypto, as they need a second transaction to change to his exchange,
>
> The centralized solution has two issues:
>
> # It locks-in the merchant to a particular payment processor whose intentions might not be aligned (e.g. Bitpay who tried to redefine Bitcoin as being a different chain, without merchant approval)
> # It has to deal with local regulations (e.g. Bitpay does not provide fiat CAD to canadian merchants)
>
> The goal of this BIP is to specify a simple protocol which makes possible decoupling of payment processors from exchanges.
>
> We believe this BIP will gather a lot of interest among local exchanges which do not have the resources to develop their own payment solutions.
>
> Their customers can decide which payment processor solution they prefer, while the exchanges give them a way to protect against cryptocurrency volatility.
>
> ==Summary==
>
> The merchant log in to its exchange website, go into "Address sources" section of it, an click on "Create a new address source".
>
> The address source creation wizard asks him questions about what to do when crypto currency is sent to this the address source. (Cryptocurrency, Market sell order, limit order of past day average etc...)
>
> The merchant receives an "address source URI" which they can input inside the payment processor.
>
> An exchange compatible with the Crypto Open Exchange Protocol would reply to any HTTP POST request to this "address source URI" returning the following information (more details in the Specification part)
>
> # A deposit address for accepting a payment
> # The current rate
> # Optional: If the exchange is willing to take the risk of rate fluctuation, until when this rate is guaranteed and under which conditions.
>
> <img src="bip-xxx/overview.png"></img>
>
> ===Interaction===
>
> * Manny (the "merchant") wants to accept Bitcoin payments on his e-commerce website.
> * Manny chooses the payment processor "PROCCO" which has a powerful plugin for his e-commerce website.
> * Manny is based in Canada and already has an account on the exchange "MYCOIN" which supports the Crypto Open Exchange Protocol.
> * Manny connects to the exchange website, and creates a new address source.
> * In the configuration screen of the address source, for each payment sent to this address source, Manny decides to keep 30% in Bitcoin and place a market sell order for the remaining 70% of the amount.
> * "MYCOIN" creates the address source, and gives the "address source URI" to the merchant. (e.g. https://example.com/addresssources/abd29ddn92 <https://example.com/addresssources/abd29ddn92>)
> * Manny copies the address source URI and goes inside "PROCCO" settings, and configures his store to use this address source URI.
>
> Now a customer, Carol, wants to order a brand new phone for 0.01 BTC on Manny's store and decides to pay in Bitcoin.
>
> * The E-Commerce website plugin requests the creation of an invoice from PROCCO.
> * PROCCO queries the "address source URI" and retrieves the rate, the expiration of this rate and conditions.
> * PROCCO can now show the Bitcoin Payment Checkout page.
> * Carla pays.
> * PROCCO marks the payment as paid and redirects to the e-commerce website.
> * MYCOIN, under its own policy (typically after 6 confirmations), credits Manny's account of 0.01 BTC and simultaneously creates a market sell order of 0.007 BTC on behalf of Manny.
>
> ==Specification==
>
> The payment processor sends a POST request to the "address source URI", the response from a Crypto Open Exchange Protocol exchange would be:
>
> If the exchange does not guarantee the rate:
>
> {
> "depositAddress" : "13....abd",
> "currencyCode" : "CAD",
> "cryptoCurrencyCode" : "BTC",
> "rate" : "15600",
> # When the merchant account get credited on the exchange
> "requiredConfirmations" : blockcount
> }
>
>
> If the exchange guarantee the rate:
>
> {
> "depositAddress" : "13....abd",
> "currencyCode" : "CAD",
> "cryptoCurrencyCode" : "BTC",
> "rate" : "15600",
> "requiredConfirmations" : blockcount
> "conditions" :
> {
> # When the transaction should be seen on the blockchain to guarantee the rate
> "receivedBefore" : timestamp,
> # When the transaction should be confirmed on the blockchain to guarantee the rate
> "confirmedBefore" : timestamp
> }
> }
>
>
> The payment processor is responsible for giving feedback to the customer if the fees of the received transaction are not enough to guarantee the rate.
>
> ==Note on adoption==
>
> While local exchanges have incentives to implement this simple protocol, it is not strictly needed.
>
> An alternative is to develop an adapter server which expose Crypto Open Exchange Protocol endpoint and connect to underlying exchange's API.
>
> The only downside is that the rate can't be guaranteed.
>
> ==Copyright==
>
> This document is dual licensed as BSD 3-clause, and Creative Commons CC0 1.0 Universal.
>
>
> Nicolas,
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
[-- Attachment #1.2: Type: text/html, Size: 15032 bytes --]
[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2017-12-20 8:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-20 6:28 [bitcoin-dev] BIP Proposal: Crypto Open Exchange Protocol (COX) Nicolas Dorier
2017-12-20 6:50 ` Dan Libby
2017-12-20 8:49 ` Sjors Provoost [this message]
2017-12-21 8:20 ` Nicolas Dorier
2017-12-21 9:04 ` Sjors Provoost
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=A2014DA0-F6F8-470F-A167-E66723281269@sprovoost.nl \
--to=sjors@sprovoost.nl \
--cc=bitcoin-dev@lists.linuxfoundation.org \
--cc=nicolas.dorier@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox