From: shaker521@hushmail.com
To: "Wladimir" <laanwj@gmail.com>
Cc: Bitcoin Dev <bitcoin-development@lists.sourceforge.net>
Subject: Re: [Bitcoin-development] BIP 0021 idea: sendmany
Date: Wed, 22 May 2013 18:01:08 +0000 [thread overview]
Message-ID: <20130522180111.D88AEE6736@smtp.hushmail.com> (raw)
In-Reply-To: <CA+s+GJD2Ty-pUcAV1HsztHjrBqJXzN-Z9XL_ideUpmN02V=pCQ@mail.gmail.com>
You can pull use cases out of thin air. Humble Bundle is a perfect example.
BIP 0001 instructed me to introduce the idea here before performing the labor of writing a new BIP. If others reply in support then the labor will be justified.
The intended purpose is to give users the simplest way to perform a transaction with multiple outputs. Ideal would be to provide a single URI (or QR code or what have you) that specifies all of the outputs (address:amount pairs) and minimizes opportunities for user error, e.g. by omitting or altering an output. I'll take you through the process that brought me to the solution below.
The main part of the current bitcoin URI scheme is a single bitcoinaddress. If the sendmany scheme left this foundation unchanged there will be difficulty with both semantics and backwards compatibility.
Contemplate some use cases for sendmany URIs. Are each of the outputs in a given transaction equally important? In other words, are all outputs necessary to fulfill the terms of the exchange between the parties? I would say so.
Not that the bitcoin client should forbid changing the outputs after processing the URI, but that it should reject the entire URI if the client does not support the multi-output syntax.
The discussion of backward compatibility in BIP 0021 recommends against reqparams being used in a mission-critical way while users upgrade their clients. A reqparams approach would permit the gravest possible error, i.e. an older client silently discarding all but the first address and allowing the user unwittingly to violate the terms of the exchange AND irreversibly send some BTC to a possibly adversarial party. We must guard against this potentially devastating failure mode.
After a study of pchar and other BNF terms (http://www.w3.org/TR/hdml20-8.html) I propose the following format with optional labels and amounts:
bitcoin:label/address:amount;label/address:amount?params
Before arriving at this format I tried and rejected these other output formats:
address/label:amount (ambiguous since ":" and amount are allowed in label's *pchar)
address:amount/label (less readable since the label is split from its referent)
The proposed format keeps labels and addresses together for human readability. The label delimiter "/" is a reserved character which eliminates ambiguous cases, making this format easy for bitcoin clients to parse.
Therefore I propose the following grammar:
bitcoinurn = "bitcoin:" outputs [ "?" bitcoinparams ]
outputs = output *[ ";" output ] | bitcoinaddress
output = [ label "/" ] bitcoinaddress [ ":" amount ]
bitcoinaddress = base58 *base58
amount = *digit [ "." *digit ]
bitcoinparams = bitcoinparam *[ "&" bitcoinparam ]
bitcoinparam = amountparam | labelparam | messageparam | otherparam | reqparam
amountparam = "amount=" amount
labelparam = "label=" label
label = *pchar
messageparam = "message=" *pchar
otherparam = pchar *pchar "=" *pchar
reqparam = "req-" pchar *pchar "=" *pchar
This may be added under "Simpler syntax":
bitcoin:<address>[:<amount>][/<label>][;<address>[:<amount>][/<label>]][?message=<message>]
As well as these examples:
bitcoin:Bitcoin+Foundation/1BTCorgHwCg6u2YSAWKgS17qUad6kHmtQW
bitcoin:eBook+Store/175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W:0.1;Bob+Author/1F4JfsqiDTG7vjnsz5daUrz2yexQGXB8uo:1.9?message=Purchased+eBook:+Bobgraphy
Brief testing with MultiBit shows that the URIs above are fully rejected by the client. This is the desired behavior for clients lacking support for multiple-output URIs. Thus we guard against the devastating failure mode outlined above.
Do you appreciate my work? Send a tip:
1F4JfsqiDTG7vjnsz5daUrz2yexQGXB8uo
next prev parent reply other threads:[~2013-05-22 18:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-22 3:25 [Bitcoin-development] BIP 0021 idea: sendmany shaker521
2013-05-22 8:46 ` Wladimir
2013-05-22 18:01 ` shaker521 [this message]
2013-05-22 18:10 ` shaker521
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=20130522180111.D88AEE6736@smtp.hushmail.com \
--to=shaker521@hushmail.com \
--cc=bitcoin-development@lists.sourceforge.net \
--cc=laanwj@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