Bitcoin block notify definitions
Blocks are organized into a linear sequence over time also known as the block chain. New transactions are constantly being processed by miners into new blocks which are added to the end of the chain.
As blocks are buried deeper and deeper into the blockchain they become harder and harder to change or remove, this gives rise of bitcoin's Irreversible Transactions. Each block contains, among other things, a record of some or all recent transactions , and a reference to the block that came immediately before it. It also contains an answer to a difficult-to-solve mathematical puzzle - the answer to which is unique to each block. New blocks cannot be submitted to the network without the correct answer - the process of " mining " is essentially the process of competing to be the next to find the answer that "solves" the current block.
The mathematical problem in each block is extremely difficult to solve, but once a valid solution is found, it is very easy for the rest of the network to confirm that the solution is correct. There are multiple valid solutions for any given block - only one of the solutions needs to be found for the block to be solved. Because there is a reward of brand new bitcoins for solving each block, every block also contains a record of which Bitcoin addresses or scripts are entitled to receive the reward.
This record is known as a generation transaction, or a coinbase transaction, and is always the first transaction appearing in every block. The number of Bitcoins generated per block starts at 50 and is halved every , blocks about four years.
Bitcoin transactions are broadcast to the network by the sender, and all peers trying to solve blocks collect the transaction records and add them to the block they are working to solve. Miners get incentive to include transactions in their blocks because of attached transaction fees. The difficulty of the mathematical problem is automatically adjusted by the network, such that it targets a goal of solving an average of 6 blocks per hour. Every blocks solved in about two weeks , all Bitcoin clients compare the actual number created with this goal and modify the target by the percentage that it varied.
The network comes to a consensus and automatically increases or decreases the difficulty of generating blocks. Because each block contains a reference to the prior block, the collection of all blocks in existence can be said to form a chain. However, it's possible for the chain to have temporary splits - for example, if two miners arrive at two different valid solutions for the same block at the same time, unbeknownst to one another. The peer-to-peer network is designed to resolve these splits within a short period of time, so that only one branch of the chain survives.
The client accepts the 'longest' chain of blocks as valid. The 'length' of the entire block chain refers to the chain with the most combined difficulty, not the one with the most blocks. One of the difficulties involved with receiving bitcoin payments is the need to generate a unique address for each new user or invoice. These addresses need to monitored and stored securely. The blockchain receive payments API takes care of the generation and monitoring of addresses.
We will notify your server using a simple callback whenever a payment is received. The easiest way to start receiving payments is to open a Blockchain Wallet at https: You should create a new account inside your wallet exclusively for transactions facilitated by this API.
This method creates a unique address which should be presented to the customer. For any payments sent to this address, you will be sent an HTTP notification. This is done so you do not show the same address to two different customers.
However, all funds will still show within the same account. As defined in BIP 44, wallet software will not scan past 20 unused addresses. Given enough requests from this API that don't have a matching payment, you could generate addresses past this horizon, which would make spending funds paid to those addresses quite difficult.
For this reason, this API will return an error and refuse to generate new addresses if it detects it would create a gap of over 20 unused addresses.
If you encounter this error, you will either need to switch to a new xPub within the same wallet is fine , or receive a payment to one of the previous 20 created addresses. Please note, this will not increase the number of addresses that will be monitored by our servers. Using this feature will require you understand the gap limitation and how to handle it for advanced users only:. You will be sent an HTTP notification immediately when a transaction is made, and subsequently when it reaches the number of confirmations specified in the request.
You are required to specify the request's notification behaviour. Setting the behaviour to 'DELETE' will delete the request after the first relelvant notification is sent to your callback address.
Setting the behaviour to 'KEEP' will send additional notifications every time a transaction with the specified confirmations and operation type is sent to or from the address in the request.
Operation type is an optional parameter indicating whether the address will be monitored for received or spent transactions, or both. By default both operation types are monitored. You may also optionally specify the number of confirmations a transaction reaches before being sent a notification.
Note that you will receive a notification at 0 confirmations i.