Define Programming

Menu
  • HOME
  • PROGRAMMING
  • NETWORKING
  • TECHNOLOGY
  • INTERNET
  • SEO
  • TECH NEWS
  • SMART PHONE

How bitcoins and bitcoin wallet transaction work online

Bitcoin

Now we leave Infocoin and turn to the real Bitcoin protocol. Bitcoin does not differ much from Infocoin, which we build step by step except for a remarkable change.

To use bitcoin, you must first install a wallet on your computer. For a better understanding, the image below is a screenshot of a portfolio called Multibit. You can see the bitcoin balance in the upper left corner – 0.06555555 bitcoin – almost $ 70, based on the current transaction price of the screenshot. The screenshot on the right shows the two most recent deals, where they deposit 0.06555555 bitcoins.

bitcoin wallet

bitcoin wallet

Suppose you are a company, you have prepared an online store and you decide to allow customers to pay in bitcoin. What you need to do is generate a new Bitcoin address with your wallet program. It automatically generates some public and private keys and hashes your public key to form your Bitcoin address.

bitcoin converter

bitcoin converter

Then send your bitcoin address to the person who will pay you. You can use the mailbox or directly on your web page. This is safe because your address is just a public key hash and you can safely publish it to someone (no one can get your private key through it). I’ll explain later why the Bitcoin address uses the public key hash instead of the public key itself.

Now, this person who is willing to pay must make a new deal. Let’s look at actual transaction data at 0.319 bitcoins. The following is almost the original data, there are three changes:

1) the data is not continuous;

2) added the line number to better understand it;

3) omitted a long hash of data,

just keeping the Top 6.

1. {"hash": "7c4025 ...",
2. "ver": 1,
3. "vin_sz": 1,
4. "vout_sz": 1,
5. "lock_time": 0,
6. "size": 224,
7. "in": [
8. {"prev_out":
9. {"hash": "2007ae ...",
10. "n": 0},
11. "scriptSig": "304502 ... 042b2d ..."}],
12. "out": [
13. {"value": "0.31900000",
14. "scriptPubKey": "OP_DUP OP_HASH160 a7db6f OP_EQUALVERIFY OP_CHECKSIG"}]}

Let’s explain this line by line.

Line 1, the transaction’s hash value (hexadecimal), is the only token that is used to represent this transaction.

Line 2 tells us that this transaction uses the first version of the bitcoin protocol.

Lines 3 and 4 tell us that the transaction has an input and an output. (A transaction can have multiple entries and multiple exits)

Line 5, a lock_time, can be used to determine when this transaction completes. Most bitcoin transactions now have a blocking time of zero, which means that the transaction is completed immediately.

Rule 6, tell us the size of the transaction how many bytes (bytes), note that this is not the transaction fee.

On lines 7 through 11, this section defines the entry for the transaction. Specifically, lines 8 to 10 tell us that the transfer value for money transfer is derived from the last export of transactions. That 2007a … is the hexadecimal hash of the last transaction used to point to the last transaction. n = 0 says this is the first result of the last transaction and we’ll see how multiple entries and exits get a bit, so do not worry now. Rule 11 is the digital signature of the person who sent the money: 304502 … After space is your public key: 04b2d … Again, both are hexadecimal

It is noteworthy that the entry section here does not say bitcoin in the previous transaction, how much will be transferred to the latter. In fact, all bitcoins in the output of n = 0 were transferred in the previous transaction. For example, if there are two bitcoins in the first output (n = 0) of the previous transaction, both are issued in the new transaction. This may seem uncomfortable, like buying a slice of bread for $ 20 in cash. The solution is to provide a change mechanism that can be solved by multiple inputs and outputs, as explained in the next section.

Line 12 to 14, this defines the outcome of the transaction. In particular, line 13 gives us the cashout amount, here is 0.319 bitcoin. The rule 14 is more complicated, it is worth mentioning that the string a7db6f … is the bitcoin address. This rule is actually a Bitcoin scripting language, where the details of the scripting language are not exhaustive. You just need to know that a7db6f … is the address you received.

Bitcoin blockchain

Now you can see how bitcoin solved the “serial number issue” problem of the problem we mentioned earlier. First, bitcoin is not a separate currency, but a long list of transactions that exist in the blockchain. It’s a smart idea to implement Bitcoin, saving a trading Wallet. Secondly, we do not need a central agency in this way to issue serial numbers. The serial number can be obtained by the hash transaction itself.

We can always look back over the chain of transactions. At the end of the day, there are two possibilities. First, you can expect the first bitcoin transaction. The transaction is in a block. We call this block “Genesis block”. This is a special agreement, has no entry, only 50 bitcoin results. In other words, it is the first delivery of bitcoins. Genesis block bitcoin client is treated differently, did not work here.

The second thing that went straight from the retail chain is that you reached an agreement called ‘coinbase’. In addition to the Genesis block, each block begins with a special mint base transaction. This transaction is used to reward the miners who verified the transactions in this block. It uses a data form that resembles the form described above, without details, and can be read here for interest in trading currencies.

What is not clear is that what is digitally signed on line 11 is exactly what it is. The most obvious way is that the payer digitally signs the entire transaction. It is not finished now and some promotions are being ignored. This makes plasticity part of the transaction, that is, it can be changed later. However, plastic content does not include the number of transactions, payers, and beneficiaries. The problem of plasticity There is a lot of discussion in the Bitcoin community and some people want to cancel.

There are several input and output operations

In the last paragraph, we talked about an input data and an export transaction. In fact, most Bitcoin transactions have multiple entries or multiple exits. Let’s look at the raw data for this transaction

1. {"hash": "993830 ...",
2. "ver": 1,
3. "vin_sz": 3,
4. "vout_sz": 2,
5. "lock_time": 0,
6. "size": 552,
7. "in": [
8. {"prev_out": {
9. "hash": "3beabc ...",
10. "n": 0},
11. "scriptSig": "304402 ... 04c7d2 ..."},
12. {"prev_out": {
13. "hash": "fdae9b ...",
14. "n": 0},
15. "scriptSig": "304502 ... 026e15 ..."},
16. {"prev_out": {
17. "hash": "20c86b ...",
18. "n": 1},
19. "scriptSig": "304402 ... 038a52 ..."}],
20. "out": [
21. {"value": "0.01068000",
22. "scriptPubKey": "OP_DUP OP_HASH160 e8c306 ... OP_EQUALVERIFY OP_CHECKSIG"},
23. {"value": "4.00000000",
24. "scriptPubKey": "OP_DUP OP_HASH160 d644e3 ... OP_EQUALVERIFY OP_CHECKSIG"}]}

As explained earlier, most of them are the same as now.

Line 1, the hash value of the transaction, is used as the only token for this transaction.

Line 2, version of the bitcoin protocol, first edition.

Lines 3 and 4 mean that there are 3 inputs and 2 outputs in this transaction.

Rule 5, blocking time (same as before).

Rule 6, the size of the transaction.

Line 7-19 defines all entries, each corresponding to the result of the previous transaction. The first entry is 8 to 11 lines. The content is the same as before. The second entry is 12 to 15 lines, the third is 16 to 19 lines.

Lines 20 to 24 define all outputs, the first being lines 21 and 22, as before, 21 lines having 0.01068 bitcoins in. Line 22 is a bitcoin scripting language. The string e8c30622 … is the address of the payee. The second result is 23 and 24 lines, the same format.

What seems strange is that although there is a record number of bitcoins for each output, there is no input. Of course, how much bitcoin is entered for each transaction can be obtained from the last transaction. In a normal bitcoin transaction, the sum of all input values is greater than the largest output (except the Genesis block and the transactions with the currency base just described). If the sum of the entries is greater than the output, the extra bitcoin is used. Transaction costs are provided to the miner in the block where the transaction is located.

The effect of multiple inputs and outputs is to change zero. Suppose I want to give you 0.15 bitcoins. I can issue 0.2 bitcoins I received earlier. Of course, I do not want to give it all 0.2, so the solution is that I have sent 0.15 bitcoins and send 0.05 bitcoins to my other Bitcoin address. So that’s 0.05 to give me the change. The concept is not the same as changing your face in the reality store, and it’s more like paying for yourself. But the general meaning is the same.

Conclusion

The basic concepts behind Bitcoin are descriptive. Of course I also neglected many details – after all, it is not a formal description. But what I want to describe is the concept behind the bitcoin commonly used.

Although the rules behind Bitcoin are simple and easy to understand, this does not mean that all the possible outcomes that these rules produce are also easy to understand. There are many other things to say about bitcoin, and I will address some of the future articles. But now let me make some summaries.

How is bitcoin anonymous? Many people say that bitcoin can be used anonymously. This statement originated on the black market, such as Silk Road. However, this statement is fictitious. The blockchain is public, which means that everyone can view all bitcoins transactions. While Bitcoin’s addresses do not directly correspond to the identity of people in the real world, computer scientists have done a lot to decipher “anonymous” social networks. The blockchain is an excellent target for them. In the near future, I would be very surprised if the majority of Bitcoin users still did not care for themselves.

This identification may or may not be fully validated, but is sufficient to offer a great chance of success. Identities will also be traceable, meaning that those who sold drugs on Silk Road in 2011 will continue to be blocked by 2020. These anti-anonymous technologies are familiar to computer scientists and may even be said to be the NSA from the USA). If NSA or other agencies have many anonimists, I would not be surprised. It’s a bit funny that bitcoin is advertised as anonymous. It is not anonymous, on the contrary, bitcoin may be by far the most open and transparent financial instrument in the world.

Can you get rich by bitcoin?

Maybe Tim O’Reilly once said, “Money is like the oil in your car – you have to be careful or you’re stuck on the sidewalk – but life is not near the gas station!” Most of the interest bitcoins seemed to be of those whose life goals were simply to find a great gas station. I have to admit this is confusing. I believe it is more interesting and fun to see bitcoin or other digital coins as a tool to shape new forms of human cooperation. It is quite fascinating, offers great opportunities for innovation, is socially valuable and can also generate some money. But if making money is your primary goal, I believe there are other ways to succeed more easily.

Details I ignored:

Although this article outlines the key concepts behind Bitcoin, there are many details that I have not mentioned. One is a great space-saving hint in the protocol, based on a data structure called Merkle-tree. These are the details, but it is an extraordinarily beautiful detail that is worth looking for if you like the data structure. You can learn about the situation through the bitcoins white paper. Secondly, I barely mention networking bitcoin – some issues like how the network handles rejected server attacks, how nodes join and leave the network, and so on. This is a very interesting topic, but it is also a subject that contains many details, so I left it here. You can read more about this through some of the links above.

Bitcoin Script:

In this article, I explain bitcoins as electronic money online. But this is only a small part of the larger and more interesting story. As we can see, there is a Bitcoins scripting language in every bitcoin transaction. This script is simplified in this article to something like “My Alice gives Bob 10 bitcoins”. But this scripting language can be used simultaneously to represent more complex transactions. In other words, bitcoin is a programmable currency. In a future article, I will explain this script system and how can I use bitcoin scripts as a platform to support a wide range of incredible financial products.

Share Us
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
Prev Article
Next Article

Related Articles

How to learn computer programming
In this era of information, computer programming occupy an increasingly …

How to learn computer programming

Share Us                

how to do enterprise cloud server backup

Leave a Reply

Cancel reply

Find us on Facebook

  • Popular
  • Recent

Define Programming

About Us

Mattis ac condimentum sed, iaculis et dui. Integer non lectus luctus, sodales nulla in, blandit dolor.

Nullam quis dolor sed nisi sollicitudin vehicula ac sed magna. Praesent tincidunt facilisis nisl, sit amet suscipit tellus congue nec.

Archives

  • March 2018
  • January 2018
  • December 2017
  • November 2017
  • October 2017

Connect With Us

Copyright © 2018 Define Programming
Theme by Defineprogramming.com

Ad Blocker Detected

Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker.

Refresh