User Tools

Site Tools


http-micropayments

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
http-micropayments [2015/10/24 10:23]
donpdonp
http-micropayments [2015/10/24 11:12]
donpdonp
Line 1: Line 1:
-## Micropayments+## Cryptocoin HTTP Micropayments
  
-HTTP Header+ 
 +#### Retrieving payment data for a resource/​URI 
 +  * GET <​URI>​ 
 +    * 200 or 402: receives json txout/addr in header. 
 +    * OR second request with content-type:​ application/​micropayment -> receives json 
 +  * Uses browser extension to handle bitcoin private keys and sign the txout. 
 +  * POST <​URI>​ 
 +    * content-type:​ application/​micropayment;​ sends {tx: '​tx',​ refund: '​addr',​ etc.} 
 + 
 +#### HTTP Header 
 +encoded in no-spaces json. 
 + 
 +Paying to a txout is more featureful.
 ``` ```
-X-micropayment: ​[protocol]+X-micropayment: ​{"​type":"​btc","​txout":"​..."​} 
 +``` 
 +or simply list receiving address 
 +``` 
 +X-micropayment:​ {"​type":"​btc","​addr":"​..."​}
 ``` ```
  
Line 10: Line 26:
   * "​amount"​ : bitcoin amount to be sent (optional, in which case the client asks the user).   * "​amount"​ : bitcoin amount to be sent (optional, in which case the client asks the user).
  
-  * GET / 
-    * 200 or 402: receives txout in headers. computes signed tx. 
-  * POST /  
-    * content-type:​ application/​micropayment;​ sends signed TX 
-    * content-type:​ application/​json;​ sends {tx: '​tx',​ refund: '​addr',​ etc.} 
  
-Fastest: client signs TX, hands to server (no bitcoin network involved). Server can selectively run various checks, including submitting to the bitcoin network and waiting, or trusting valid signature and current known balance.+#### processing payment 
 +Fastest: client signs TX, hands to server (no bitcoin network involved). Server can selectively run various checks, including submitting to the bitcoin network and waiting, or trusting valid signature and recent ​balance. 
 + 
 +Post of signed TX is optional. If donation/​suggested,​ one option is to submit the payment and do nothing. 
 + 
 +#### Cons 
 +  * payment info in http headers is likely to be lost when content is re-uploaded (eg, uploaded to IPFS).  
 +    * Better to embed in HTML doc 
 +    * other mime types? png/​jpeg/​mp4 
http-micropayments.txt · Last modified: 2016/06/25 11:25 (external edit)