Blockchain development topics (how digital currencies can be paid for transactions)

Source: Internet
Author: User
Tags new features valid

Blockchain Enthusiast (qq:53016353)


Request payment before requesting payment, the program needs to generate a Bitcoin address first or from another program, such as Bitcoin Core, to obtain an address. The details of the Bitcoin address are described in the transaction section, and in this section there are two important reasons why you should avoid using the same Bitcoin address multiple times-and the third reason is related to the payment request.
Using a separate address for each collection makes it more cumbersome to identify the payment customer status. The program only needs to track a specific payment request and the address it contains, then search the blockchain and query the transaction that matches that address to confirm the identity.
The next section details four mutually compatible methods to provide payment addresses and amounts to the payer. For convenience and compatibility reasons, it is recommended to support all the methods described.
1. The Wallet program allows the user to paste or manually enter the address and payment amount in the payment interface. Of course, this approach is inconvenient, but it provides an effective retreat option.
2. Almost all desktop wallets can be linked to the Bitcoin:uris, the payer only need to click the link to go directly to the payment interface, while the payment address and the amount has been pre-completed. Many mobile wallets also support this feature, but web wallets are not supported, except by installing a browser extender or configuring a URI link handle.
3. Most mobile wallets support the scanning of QR codes containing bitcoin:uris encoded information, and almost all wallet programs support the display of the incoming two-dimensional code. This also facilitates online orders, and QR codes are useful for in-person trading.
4. Recent wallet updates have increased the support for a new payment protocol, which improves payment security and introduces some important new features such as refunds, by certifying the payee identity through the certificates of the certificate.
Warning: There is a need to be particularly cautious about the theft of payments for collections. In particular, it is important to note that the private key must never be stored on a network server, and payment requests need to be encrypted via HTTPS or other means to prevent a man-in-the-middle attack from replacing the payee address.






Plain text
If you need to be able to determine the amount of payment only by means of copy and paste, you need to provide the address, quantity and unit. Of course, it is also best to include a valid time, for example:
(Note: All examples in this section use Testnet addresses.) )
Pay:mjsk1ny9spzu2fouzyglqgud8u41ir35qn
AMOUNT:100 Digital currency
You must pay by:2014-04-01 at 23:00 UTC

Units must be specified. At the time of writing all the popular Bitcoin wallet program default display units are Bitcoins (digital currency) or millibits (M digital currency). Most of them support selecting a digital currency or one of the M digital currencies as the display unit, and some programs support the following units.
Bitcoins
Unit (abbreviation)
1.0
Bitcoin (digital currency)
0.01
Bitcent (c digital currency)
0.001
Millibit (M digital currency)
0.000001
Microbit (U digital currency)
0.00000001
Satoshi

Since both the digital currency and the M-digital currency are widely accepted, it is more intuitive to specify the amounts under both units when defining payment orders in copy-and-paste text. For example:
Pay:mjsk1ny9spzu2fouzyglqgud8u41ir35qn
amount:100 Digital currency (100000 m digital currency)
You must pay by:2014-04-01 at 23:00 UTC
Bitcoin:uri
The Bitcoin:uri scheme defined in BIP21 eliminates the confusion of payment units that may appear in the copy-and-paste text of the payer. It is also possible to provide additional information to the payer by paying the order. As an example:
bitcoin:mjsk1ny9spzu2fouzyglqgud8u41ir35qn?amount=100
Only addresses are necessary, and if only addresses are defined, the wallet generates a payment request with a pre-filled address, requiring the payer to enter the amount of the payment.
The number of payments is always determined in decimal form of the digital currency, and for the number of integers in the digital currency (as in the example above), the decimal point can be omitted. 0 of the number of decimal digits of the digital currency can be omitted; For example, the 1m digital currency request in the following example is valid:
bitcoin:mjsk1ny9spzu2fouzyglqgud8u41ir35qn?amount=.001
bitcoin:mjsk1ny9spzu2fouzyglqgud8u41ir35qn?amount=0.001
There are also two widely supported parameter labels and message. The label parameter is used to identify the payee name, and the message parameter is usually used by the payer to describe the payment request. The label and message parameters are stored in the Payer wallet program and are not included in the actual transaction, so the other Bitcoin users cannot see the two parameter information. These two parameters must be encoded by URI.
The four parameters are set up, and the change of career is shown in the following form by URI encoding.
Bitcoin:mjsk1ny9spzu2fouzyglqgud8u41ir35qn\
? amount=0.10\
&label=example+merchant\
&message=order+of+flowers+%26+chocolates
The above URI can be encoded in HTML format to be compatible with wallet programs that do not support URI chaining, and can provide a valid time to the payer.
? amount=0.10\
&label=example+merchant\
&message=order+of+flowers+%26+chocolates "
>order Flowers & Chocolate using Bitcoin
(Pay 0.10 digital currency [m digital currency] to MJSK1NY9SPZU2FOUZYGLQGUD8U41IR35QN by 2014-04-01 at 23:00 UTC)
The above code generation links are as follows:
Order Flowers & Chocolates using Bitcoin (pay 0.10 digital currency [m digital currency] to MJSK1NY9SPZU2FOUZYGLQGUD8U41IR35QN by 2014-04-0 1 at 23:00 UTC)
Some orders indicate a valid remaining payment time by displaying a countdown with JavaScript.
As you can see in the Payment Protocol section later in this article, the URI scheme can be extended with new optional and necessary parameters. At the time of writing, the only new parameter that was widely accepted was the R parameter in the payment protocol.
Regardless of which form of URIs Link is supported, the program ultimately needs to be prompted by the user to eventually confirm the payment, unless the user explicitly disables the prompt (which can be used for small payments).
QR code
QR code can be used to exchange bitcoin:uris information, widely used in face trading, images or images. Most mobile wallet programs and some desktop wallet programs support scanning the QR code and go directly to the pre-fill payment interface.
The four bitcoin QR codes in the following figure show the same Bitcoin:uris code, which is generated with four different levels of error correction (shown above the QR code). The QR code can contain the label and message parameters, as well as other optional parameters. In this example in order to compress the size of the QR code and ensure that the lower quality of the camera can be easily scanned successfully, does not include additional parameters.



The QR Code provides four different levels of error correction:
1. Low: Up to 7% loss of image can be repaired
2. Medium: Up to 15% of the image loss can be repaired, but the QR code area is nearly 8% larger than the low-level repair level image.
3. Four: Up to 25% image loss can be repaired, but the QR code area is nearly 20% larger than the low-level repair level image.
4. High: Up to 30% image loss can be repaired, but the QR code area is nearly 26% larger than the low level repair level image.
Error correction with calibration and (checksum) can ensure that the bitcoin QR code information is complete and not accidentally modified, so your program needs to select the correct level of error correction for different display areas. The display area has a limited time low error correction level is more suitable, and when the high-resolution display capability of the four-bit correction level can help achieve fast scan code.




Payment Agreement
The bitcoin core 0.9 version supports new payment agreements. New payment agreements add a number of important features to your payment needs.
· Supports both authentication and SSL encryption to enable authentication of the recipient's identity and prevents a malicious attack by the middleman.
· To provide more payment process

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.