GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Spend your coin remake by andrasfuchs · Pull Request #104 · ProgrammingBlockchain/ProgrammingBlockchain Conversation
|
| What happens to the remaining **70 µBTC**? This is the _miner fee_. | ||
| The miner fee incentivizes the miners to add this transaction into their next block. The higher the miner fee the more motivated the miner is to include your transaction in the next block, meaning that your transaction will be confirmed faster. If you set the miner fee to zero, your transaction might never be confirmed. | ||
|
|
||
|  |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I don't like the new illustration. There is no consensus on uBTC. Plus the miner fee was previously illustrated by having a smaller coin that goes for the miner.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Hmm, interesting, I thought that the different sizes for the icons were just a mistake, it looked funny and pixelarated to me. Alright, I can change it back to various sizes. The amount of the miner fee was missing from the previous version, that wasn't intentional I suppose?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It was intentional, denoting "it's so small, it doesn't matter." Unfortunately it's not the case anymore :(
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Agree with @nopara73 about the size, I think you could use bits though.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Ok, so I'll change the size of the coins back and I'll use bits instead on uBTC.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| So now that you know what a **bitcoin address**, a **ScriptPubKey**, a **private key** and a **miner** are, you will make your first **transaction** by hand. | ||
|
|
||
| As you proceed through this lesson you will add code line by line as it is presented to build a method that will leave feedback for the book in a Twitter style message. | ||
| As you proceed through this lesson you will add code line by line as it is presented to build a method that will leave feedback for the book in a Twitter style message. I _highly recommend_ you to follow the instructions first on the TestNet and after do them again on the Main Bitcoin network. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Mainnet practice is more memorable. If you have money on the line you are more inclined to pay attention.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I agree, but all the samples in the chapter were and are on TestNet, so to avoid confusion I wanted to make clear that it is better to start with the testnet and then go on and repeat them on mainnet.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
On my side I am OK with switching to testnet. The first chapter is still using Mainnet which is enough to "feel" your money on the line. Also now, with the high fees, such experience everywhere could be very costly. :)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Ah wait! This is the first chapter.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| ```cs | ||
| var network = Network.Main; | ||
| // Replace this with Network.Main to do this on Bitcoin MainNet |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ``` | ||
|
|
||
| Note the **bitcoinPrivateKey** and the **address**, send some coins there and note the transaction id \(you can find it, probably, in your wallet software or with a blockexplorer, like [blockchain.info](http://blockchain.info/)\). | ||
| Note that we use the TestNet first, but you will probably do this on the MainNet as well, so you are going to spend real money! **Be careful!** In any case, write down the **bitcoinPrivateKey** and the address! Send a few dollars of coins there and save the transaction ID \(you can find it in your wallet software or with a blockexplorer, like [blockchain.info](http://blockchain.info/) for MainNet or [blockcypher.com](https://live.blockcypher.com) for both MainNet and TestNet). |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Same comment about mainnet vs testnet as above. Also I believe the "be careful, pay attention" is unnecessary hand holding. If they got to this point they must be aware of the risks. Also personally I prefer recommending SmartBit, instead of blockchain.info or blockcypher, since it's written with NBitcoin, and its API is vastly superior to every other bc explorer api.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Alright, I'll remove the be careful line, I thought that it's better to err on the safe side, but it's probably unnecessary.
Regarding SmartBit: I didn't know that you prefer that, I just found a comment (#1) yesterday after created this pull request. I'll change all the links to that, no problem.
Please note, that it is terribly slow from Europe at the moment, I hope it's much better from overseas.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
+1000 for using smartbit instead on Blockchain info!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| Console.WriteLine(bitcoinPrivateKey); // cSZjE4aJNPpBtU6xvJ6J4iBzDgTmzTjbq8w2kqnYvAprBCyTsG4x | ||
| Console.WriteLine(address); // mzK6Jy5mer3ABBxfHdcxXEChsn3mkv8qJv | ||
| Console.WriteLine(bitcoinPrivateKey); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I believe, leaving a comment on the expected output is a good practice, since most people will not follow the book while coding.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Alright, I can agree on this one too. The only reason I thought that it is not so important here, because the user will have different values when he is doing the exercise (because of the different private key he generated for himself).
I'll put it back.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| TxOut changeTxOut = new TxOut() | ||
| { | ||
| Value = new Money((decimal)0.4999, MoneyUnit.BTC), | ||
| Value = new Money(530, MoneyUnit.Bit), |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| * the currently advised mining fee, | ||
| * you may consider to increase or decrease it. | ||
| */ | ||
| var minerFee = new Money(70, MoneyUnit.Bit); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| Now add your feedback! This must be less than 40 bytes, or it will crash the application. | ||
| This feedback, along with your transaction will appear \(after your transaction is confirmed\) in the [Hall of The Makers](http://n.bitcoin.ninja/). | ||
| Now add your personal feedback! This must be less than 80 bytes or your transaction will be rejected. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Isn't it maximum 80 bytes?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Let's pay attention to the details :)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
You mean the right wording would be "less then or equal to"?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Yes.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ```json | ||
| { | ||
| "hash": "b7803df4b90fd615532bcbdb3b63eb1af5a2e4ae36f29a6fbf9f57d0a1842e0a", | ||
| "hash": "579ae72016c02691a9e47258d65705575d0a6a5f265b137c67ef6be7b2a35659", |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Please pay attention for these to be consistent. I'm kind of confused during this review so I'm not sure I requested modification in the previous lines or not.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
That's again different because of the new transaction with the new values. It is consistent with the data in the block explorer.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| Let's check out the **hash** of **prev\_out** in a blockexplorer: [http://tbtc.blockr.io/api/v1/tx/info/e44587cf08b4f03b0e8b4ae7562217796ec47b8c91666681d71329b764add2e3](http://tbtc.blockr.io/api/v1/tx/info/e44587cf08b4f03b0e8b4ae7562217796ec47b8c91666681d71329b764add2e3) | ||
| In **prev\_out** **n** is 1. Since we are indexing from 0, this means I want to spend the second output of the transaction. | ||
| In the blockexplorer we can see the corresponding address is `mzK6Jy5mer3ABBxfHdcxXEChsn3mkv8qJv` and I can get the scriptSig from the address like this: | ||
| Let's check out the **hash** of **prev\_out** in a TestNet blockexplorer: [prev\_out tx details](https://live.blockcypher.com/btc-testnet/tx/0acb6e97b228b838049ffbd528571c5e3edd003f0ca8ef61940166dc3081b78a/). You can see that 0.001 BTC, so 1'000 µBTC was transferred to our address. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
As I said SmartBit would be nicer.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Ok, no problem.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| ```cs | ||
| var hallOfTheMakersAddress = BitcoinAddress.Create("mzp4No5cmCXjZUpf112B1XWsvWBfws5bbB"); | ||
| var hallOfTheMakersAddress = BitcoinAddress.Create("mzp4No5cmCXjZUpf112B1XWsvWBfws5bbB", Network.TestNet); |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
NBitcoin is intelligent enough to know it is testnet without hint, but it is better practice to specify it.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Ok so in overall I think:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
* Removed the "be careful" expression * Replaced all blockchain explorer links with SmartBit * Added back the console output comments * Fixed a few typos * Rewrote the unit description section * Changed microBTC to bits * Modified the SpendTx.png picture
|
I hope it got better, let me know what other changes you would prefer. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@nopara73 seems good to you? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@NicolasDorier Maybe. It's a little confusing. I let you decide. Issue 1: Fix typos. Anyway, if you really want to go with bits then so be it, I'm strongly against it, but I respect the consensus. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
BTC is fine with me too, I just need to spare a little time to change it back. You guys are the experts, so now that you have an agreement on it and you think bits are confusing then I remove it, no problem at all. Would you like me to remove the units section that introduces bits and satoshis as well? @nopara73 After we started to talk about this PR I realized that I made a mistake by not splitting it into a few smaller ones, so I will definitely take your advice next time :) I'll do the changes in the next few days as soon as I have a time for it. I just need a quick reply from you guys, if you want to keep the unit introduction section. Thanks! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@andrasfuchs As I said I am strongly against it. But if Nicolas insist to bits, so be it, I don't think it's that important to go to war for it. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@andrasfuchs yes you can introduce bits and satoshi. I am quite 50/50% on using Bit or BTC in examples. Someone throw a coin! @andrasfuchs let us know when ready to merge. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Changed bits to BTC
|
@NicolasDorier @nopara73 I changed the text, please check it out. I'm leaving for 2 weeks tomorrow morning and I will have very limited internet access, but I will try my best if you need me to change anything else. Thank you for your patience! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.