W3C home > Mailing lists > Public > public-webpayments@w3.org > November 2015

Re: Markup for payable HTML resources

From: Dave Longley <dlongley@digitalbazaar.com>
Date: Wed, 18 Nov 2015 10:16:52 -0500
To: Meinhard Benn <meinhard@satoshipay.io>, public-webpayments@w3.org
Message-ID: <564C9664.4010202@digitalbazaar.com>
On 11/17/2015 06:37 PM, Meinhard Benn wrote:
> Hello fellow web payment enthusiasts,
>
> I have been reading this list for a while and I'd like to introduce
> myself and ask for your opinion on an issue I'm currently trying to resolve.
>
> I am the founder of SatoshiPay and we are looking at making paying for
> web content as frictionless as possible for all parties involved. As our
> payment layer we chose bitcoin payment channels (a simple "smart
> contract" on the bitcoin blockchain), because of its extremely low
> transaction fees - think fractions of a cent. Our system works without
> any download or sign-up for the end user, because we ship a complete
> bitcoin wallet written in JavaScript with the website the payable
> content is on and instantly create a private key if the user doesn't
> have one yet.
>
> To make a simple integration for the content publisher or merchant as
> easy as possible we simply added a few data properties to HTML tags,
> which will be parsed by our JavaScript widget. In code it currently
> looks like this:
>
> <div class="satoshipay-content-item-text satoshipay-masked"
> data-content-url="http://will.satoshipay.eu/api/v1/article?id=4ypNl2BMe"
> data-satoshipay-id=563cc11c8c823d110025e951 data-content-length=1170
> data-price=4000></div>
> <script src="https://wallet.satoshipay.io/satoshipay.js"></script>
>
> Dump this anywhere on any website and it will just work. Your payments
> will be donated to our office coffee fund. :)
>
> Some documentation for the enriched div tag:
>
> <div
>    /* trigger class, plus design */
>      class="satoshipay-content-item-text satoshipay-masked"
>    /* content URL after payment */
>      data-content-url="http://.../article?id=4ypNl2BMe"
>    /* product ID at SatoshiPay */
>      data-satoshipay-id=563cc11c8c823d110025e951
>    /* content length (for text) */
>      data-content-length=1170
>    /* price in satoshis (0.00000001 bitcoin) */
>      data-price=4000
>>
>
> What's happening in the http://will.satoshipay.eu/ example is that after
> top-up the JS bitcoin wallet connects to the SatoshiPay server via
> WebSocket, negotiates the smart contract and moves funds to a multi-sig
> bitcoin address. With each payment the contract gets adjusted and a
> payment certificate is issued to the client by the SatoshiPay server.
> This certificate (currently a pre-shared secret) is shown by the client
> to the content server, which then ships the content. At no point
> SatoshiPay ever holds control over funds. We are merely the broker.
>
> Now, while the payments work fine, there are a few issues with the
> markup above as it's neither flexible nor consistent. So that's my where
> my question starts. My current idea is to redesign as follows:
>
> <div
>    data-sp-type="text/html"
>    data-sp-url="/paid-content/1?spCert=%s"
>    data-sp-id="563cc11c8c823d110025e951"
>    data-sp-currency="XBT"
>    data-sp-price="0.00004"
>    data-sp-length="1170"
>>
>
> Improvements:
>
>   - there is a vendor prefix
>   - different text types could be rendered and styled differently
>   - the position of the SatoshiPay payment cert in the content retrieval
>     URL can be controlled by the publisher
>   - different currencies are supported
>   - price denomination meets a standard
>
> A payable image could look like this:
>
> <img
>    data-sp-type="image/png"
>    data-sp-url="/paid-images/1?spCert=%s"
>    data-sp-id="abcdef"
>    data-sp-currency="XBT"
>    data-sp-price="0.00006"
>    height="600"
>    width="800"
>>
>
> Video/audio tags and download links would follow a similar pattern.
>
> So, I was wondering, did you spend some time on thinking about a
> standard for this already? The only W3C resource I found is a retired
> draft from 1999: http://www.w3.org/TR/Micropayment-Markup/
>
> On https://www.w3.org/community/webpayments/ I see a lot of JSON, but no
> HTML markup.
>
> Other thoughts? Are we thinking the right direction here?

Expressing asset, offer, and payment information directly in Web pages 
has been considered before in the past and implemented in some 
experimental systems (via members from the Web Payments CG), for example:

https://web-payments.org/specs/source/web-commerce/#the-purchase-process

However, the Web Payments IG decided to scale back the first phase of 
standardizing payments on the Web to focus primarily on the most basic 
flow of a payment from request through completion. We're taking an 
incremental approach.

That being said, if we get this step right, then what we build in the 
first phase should be easily extended later to provide more powerful 
features like embedding machine-readable offers in Web pages (see: 
https://developers.google.com/schemas/formats/json-ld?hl=en).

One proposal to the WG is to use JSON-LD as the format for messages like 
payment requests. This format allows for easy, decentralized extension, 
so, looking forward, there is room to explore a wider ecosystem in the 
future.

However, the current WG has a very limited scope to help ensure success 
-- so I wouldn't expect to see anything in phase I, but perhaps a later 
phase.


-- 
Dave Longley
CTO
Digital Bazaar, Inc.
http://digitalbazaar.com
Received on Wednesday, 18 November 2015 15:17:17 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:07:43 UTC