Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: jago25_98 on December 22, 2010, 07:09:30 AM



Title: Flattr like functionality using "open with..." filetype mime
Post by: jago25_98 on December 22, 2010, 07:09:30 AM
 
 If we had a filetype, such as .bitcoin,
we could have that filetype open bitcoin to send a payment without needing to copy and paste the address.

 You could have the payment to info stored in an xml file:

- amount to pay
- address to pay to
- comment (this could be used to identify the product or tip in the case of a flattr type setup)

 Of course, the file would have to be rigorously checked to avoid abuse.


Title: Re: Flattr like functionality using "open with..." filetype mime
Post by: MoonShadow on December 22, 2010, 07:23:37 AM
Could the XML file be signed in such a way that a bitcoin client could check the authentisity?


Title: Re: Flattr like functionality using "open with..." filetype mime
Post by: grondilu on December 22, 2010, 08:33:42 AM
The .bitcoin file could look like this :

Code:
1Hy9dexzNzjvQYkYy6zKRVZMU8k2j5vuPt;1; some comment

The associated command would be :

Code:
#!/bin/bash

if [[ -z "$1" ]]
then echo "usage: $0 bitcoin-file" ; exit 1
elif
    addr="$(cut -d\; -f1 $1)"
    [[ ! "$addr" =~ ^[0-9a-zA-Z]{35}$" ]] ||
    wget -O - -q http://blockexplorer.com/address/$addr |
    grep -i -q "Invalid address"
then echo "Wrong bitcoin address or file format" ; exit 2
elif
   amount="$(cut -d\; -f2 $1)"
   [[ ! "$amount" =~ ^[1-9]+$|^0\.[0-9]+$ ]]
then echo "wrong format for amount" ; exit 3
elif
   comment="$(cut -d\; -f3 $1)"
   zenity --question --text "Do you want to send $amount to $addr with \"$comment\" as a comment ?"
then bitcoind sendtoaddress $addr $amount "$comment"
fi


This version requires the zenity package


Title: Re: Flattr like functionality using "open with..." filetype mime
Post by: jago25_98 on December 26, 2010, 11:05:22 PM
Could the XML file be signed in such a way that a bitcoin client could check the authentisity?

I'm not the most technical person here. MD5 hash should be possible yeah guys?

That mime looks like it should work straightway. Reliant on a domain name though... feels like more points of failure with a browser involved. I really meant take it straight to Bitcoin. On the other hand, that would be useful straightaway. I think better, if using a browser address to take it to Bitcoin first, pass that address and then open a browser window from there.