BIP 0020: Difference between revisions

From Bitcoin Wiki
Jump to navigation Jump to search
Luke-jr (talk | contribs)
BNF syntax
Luke-jr (talk | contribs)
No more IP tx
Line 3: Line 3:
[] means optional, <> are placeholders
[] means optional, <> are placeholders


  bitcoin://[<host>]/<address>?amount=<size><unit>[&label=<label>][&message=<message>]
  bitcoin:<address>?amount=<size><unit>[&label=<label>][&message=<message>]


=== Variables ===
=== Variables ===
Line 16: Line 16:


Just the address:
Just the address:
  bitcoin:///18pnDgDYFMAKsHTA3ZqyAi6t8q9ztaWWXt
  bitcoin:18pnDgDYFMAKsHTA3ZqyAi6t8q9ztaWWXt


Address with name:BTC
Address with name:BTC
  bitcoin:///18pnDgDYFMAKsHTA3ZqyAi6t8q9ztaWWXt?label=tcatm
  bitcoin:18pnDgDYFMAKsHTA3ZqyAi6t8q9ztaWWXt?label=tcatm


Request to send 20.30 BTC to tcatm:
Request to send 20.30 BTC to tcatm:
  bitcoin:///18pnDgDYFMAKsHTA3ZqyAi6t8q9ztaWWXt?amount=20.30BTC&label=tcatm
  bitcoin:18pnDgDYFMAKsHTA3ZqyAi6t8q9ztaWWXt?amount=20.30BTC&label=tcatm


Request to send 400 TBC to Luke:
Request to send 400 TBC to Luke:
  bitcoin:///1KczVqwopWXQdFLe5sNQbpCq7yGSmXx2oo?amount=400TBC
  bitcoin:1KczVqwopWXQdFLe5sNQbpCq7yGSmXx2oo?amount=400TBC


Request to send 5 uBTC:
Request to send 5 uBTC:
  bitcoin:///18pnDgDYFMAKsHTA3ZqyAi6t8q9ztaWWXt?amount=500
  bitcoin:18pnDgDYFMAKsHTA3ZqyAi6t8q9ztaWWXt?amount=500
 
Request to send 5 uBTC over the LAN to 192.168.1.2:
bitcoin://192.168.1.2/18pnDgDYFMAKsHTA3ZqyAi6t8q9ztaWWXt?amount=500


Request to send 50 BTC with message:
Request to send 50 BTC with message:
  bitcoin:///18pnDgDYFMAKsHTA3ZqyAi6t8qztaWWXt?amount=50BTC&label=tcatm&message=Payment%20for%20product%20xyz
  bitcoin:18pnDgDYFMAKsHTA3ZqyAi6t8qztaWWXt?amount=50BTC&label=tcatm&message=Payment%20for%20product%20xyz


Characters must be URI encoded properly.
Characters must be URI encoded properly.
== BNF Syntax ==
bitcoinurl        = "bitcoin://" [ host ] "/" bitcoinaddress [ ";version=" bitcoinversion ] [ "?" bitcoinparams ]
bitcoinaddress = FIXME :)
bitcoinversion = "1.0"
bitcoinparams = *bitcoinparam
bitcoinparam = amountparam | labelparam | messageparam
amountparam = "amount=" digits bitcoinunit
bitcoinunit = "BTC" | "ᵇTBC" | "ᵐTBC" | "ˢTBC" | "ᵗTBC" | "TBC" | "TBCᵗ" | "TBCˢ" | "TBCᵐ" | "TBCᵇ"
labelparam = "label=" *uchar
messageparam = "label=" *uchar

Revision as of 01:12, 10 January 2011

I propose a scheme like this:

[] means optional, <> are placeholders

bitcoin:<address>?amount=<size><unit>[&label=<label>][&message=<message>]

Variables

  • label: Label for that address (e.g. name of receiver)
  • address: bitcoin address
  • message: optional message that is shown to the user after scanning the QR code
  • size: amount of $unit
  • unit: BTC, [ᵗˢᵐᵇ]TBC[ᵗˢᵐᵇ], or null/omitted (which refers to the base unit)

Examples

Just the address:

bitcoin:18pnDgDYFMAKsHTA3ZqyAi6t8q9ztaWWXt

Address with name:BTC

bitcoin:18pnDgDYFMAKsHTA3ZqyAi6t8q9ztaWWXt?label=tcatm

Request to send 20.30 BTC to tcatm:

bitcoin:18pnDgDYFMAKsHTA3ZqyAi6t8q9ztaWWXt?amount=20.30BTC&label=tcatm

Request to send 400 TBC to Luke:

bitcoin:1KczVqwopWXQdFLe5sNQbpCq7yGSmXx2oo?amount=400TBC

Request to send 5 uBTC:

bitcoin:18pnDgDYFMAKsHTA3ZqyAi6t8q9ztaWWXt?amount=500

Request to send 50 BTC with message:

bitcoin:18pnDgDYFMAKsHTA3ZqyAi6t8qztaWWXt?amount=50BTC&label=tcatm&message=Payment%20for%20product%20xyz

Characters must be URI encoded properly.