GeezerVison is showing github.com — Update private_key.md by youngminpark2559 · Pull Request #81 · ProgrammingBlockchain/ProgrammingBlockchain
Conversation
For not making readers confused by giving them the idea that Bitcoin secret and private key are separated things.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
For not making readers confused by giving them the idea that Bitcoin secret and private key are separated things.
|
I agree, the turn of the sentence is a bit weird though.
I would have said
Bitcoin secret is nothing more than Private key represented in Base58Check
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
By getting Nicolas advice.
|
Sir, how do you think that below content will be attached in "private key" section as a Tip?
There are some wrong idea? Or is this needless?
In Bitcoin, we don't put raw private key into wallet or transaction for security reason.
Instead, we hash and encode raw private key into some format such as Bitcoin Secret represented in Base58Check, and generally use private key in such format. But again, Bitcoin secret is nothing more than Private key represented in Base58Check.
Since this format of private key can be used with Wallet, Bitcoin Secret is also known as Wallet Import Format(WIF).
You can see the more details and uses in "spend your coins" section of this chapter.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
I saw like that in BIP38 (Part 2) section.
|
Please anyone tells me if it's something wrong or not.
In P2PK[H] (Pay to Public Key [Hash]) section, the sentence says We learned that a Bitcoin Address was the hash of a public key.
However, they're different like this:
Console.WriteLine(publicKeyHash); // 41e0d7ab8af1ba5452b824116a31357dc931cf28
Console.WriteLine(bitcoinAddress); // 171LGoEKyVzgQstGwnTHVh3TFTgo5PsqiY
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Using Base58 does not increase security. It is just a standard to present and import public key in a human friendly way.
Code should normally use Key, and only use BitcoinSecret at the UI Layer.
But for preventing from being confused note that Bitcoin secret is nothing more than Private key represented in Base58Check.
This sentence is strange. Maybe should you add some punctuation or remove "But for preventing from being confused".
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Bitcoin Address is the hash of the public key encoded in Base58.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Thank for explanations.
I personally think that in that context, "But for preventing from being confused" is better placed there for understanding. So, I put a punctuation at the end of it.
Add contents about CombineSignatures()
|
@bokobza I resolved this conflict the same way we resolved back then. As you can see it didn't get resolved, just like back then. Do you remember what was the GitHub bug we encountered and how we solved it?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
I was confused when I was first reading this section by Key privateKey = new Key(); // generate a random private key
new Key() can be said as a private key? I think it's more near to a kind of key object.
So I edit that, if it's not appropriate, I will back to the original one.
And I add some contents for giving background basics about Base64, Base58 etc.
|
|
Before sending the transaction to the network, examine the need of CombineSignatures() method.
|
|
|
Try to compare a full detail of transaction between bobSigned and fullySigned.
|
|
|
It will seem both are identical.
|
|
|
For this reason, it seems like the CombineSignatures() method is needless because mulit-signing has achieved without the CombineSignatures() method.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
.BuildTransaction(sign: false);
|
|
|
|
|
|
|
|
|
Transaction aliceSigned =
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
.AddKeys(alice)
|
|
|
.SignTransaction(unsignedNew);
|
|
|
|
|
|
Transaction bobSigned =
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
|
|
|
The Base58Check encoding has some neat features, such as checksums to prevent typos and a lack of ambiguous characters such as '0' and 'O'.
|
|
|
The Base58Check encoding also provides a consistent way to determine the network of a given address; preventing a wallet from sending MainNet coins to a TestNet address.
|
|
|
## Encoindg schemes {# encoindg-schemes}
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks, Nicolas. I edited.
And I have a question.
In Multi Sig section, the words "multi-sig" and "ScriptPubKey" or the process of generating a ScriptPubKey don't make sense at the same time because sig means signing signature but generating a ScriptPubKey doesn't require signing signature but just a public key.
I think it's more appropriate that a ScriptPubKey is decorated by a kind of multi-publicKey rather than a multi-sig.
I wonder this.
Does the concept of multi-sig contain largely the following whole process?
1.Generating a ScriptPubKey by multiple publicKeys, and putting it into TxOut of an other getting coins transaction.
2.Proofing ownership of the recieved coins by multiple private keys or by multi-sig which is combined into one thing by multiple privatekeys.
3.Generating a scriptSig by processing multi-sig for a TxIn of a spending transaction.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
I also wonder this point.
1.
Can I solidify an idea that the process of generating a ScriptPubKey is eleminating a version byte which identifies a network type, and getting publicKey hash from a Bitcoin address(a version byte + a publicKey hash), and putting some script commands?
From above statement, can I consider the process of generating a Bitcoin address by a ScriptPubKey and network type as the same process of generating a Bitcoin address by a publicKey hash and network, except for direction(forwards for the latter, backwards for the former) and the fact that a ScriptPubKey only contains additional script commands, compared to a publicKey hash?
Can a ScriptPubKey be said as an address? Or can it be said as a value?
Got wondered from this sentence:
Notice the ScriptPubKey for testnet and mainnet address is the same ?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
-
yes byte array of 32 bytes
-
Encoders.Hex.EncodeData("key.ToBytes()")
-
Not sure what you mean, a key is needed for many operations in Bitcoin. BitcoinSecret is a Key + Network. In Bitcoin processing code, Network information is never needed.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks the review.
I tried this way.
I don't understand what you mean by Is it just a key object rather than specifying it as a private key
I thought this way,"Is it just a key object rather than specifying it as a private key?" or "Should it be named by keyObject rather than a privateKey?", when I was seeing this code:
Key privateKey = new Key();
So I thought readers would think this way too when they were seeing the code.
I'll change to the latter of the sentence which is more clear in the intention.
you instantiate a new object, not a class.
Fixed this way:
When you instantiate a Key object,
not necessarily true. On non-windows plateform it is untrue.
I think RNGCryptoServiceProvider things would be helpful for readers to understand widely, so I want to add explanations by your suggestion like this:
under the hood, in the case of .NET, you should invoke RNGCryptoServiceProvider to generate a key data and store it into a key object, which is a .NET wrapper around the Windows Cryto API. However, in the .NET, particular RNGCryptoServiceProvider is not mandatory, you can choose different generators you want to use. And also, since the RNGCryptoServiceProvider wouldn't work on the non-windows platform, you should choose appropriate generators on each platform.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
I think RNGCryptoServiceProvider things would be helpful for readers to understand widely, so I want to add explanations by your suggestion like this:
under the hood, in the case of .NET, you should invoke RNGCryptoServiceProvider to generate a key data and store it into a key object, which is a .NET wrapper around the Windows Cryto API. However, in the .NET, particular RNGCryptoServiceProvider is not mandatory, you can choose different generators you want to use. And also, since the RNGCryptoServiceProvider wouldn't work on the non-windows platform, you should choose appropriate generators on each platform.
I prefer the book does not go into such details. People can easily look the source code, the only thing they need to know is that the default is using a secure RNG.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Okay, I agree on it and I'll keep that point in mind when I'm writing.
Fixed:
42ce6ed
284c111
I have some questions on the ScriptPubKey page:
https://github.com/ProgrammingBlockchain/ProgrammingBlockchain/blob/master/bitcoin_transfer/payment_script.md
Does that mean some ScriptPubKey doesn't contain the hashed public key like this?:
OP_DUP OP_HASH160 OP_EQUALVERIFY OP_CHECKSIG
And if the omitted hashed public key represents the recipient, what's the role of that ScriptPubKey without the recipient but just script commands which are conditions?
I understood like this.
ScriptPubKey is composed of both of script commands which are opcodes and hashed public key.
Script commands may play a role explaining the conditions which should be met to claim ownership of the coins.
Hashed public key related to corresponding public key and private key may play a role explaining the address for the recipient.
But this sentence:
A ScriptPubKey does not necessarily contain the hashed public key(s) permitted to spend the bitcoin.
Hashed public key is the thing permitting someone to spend the coin which is the task related to proof the ownership of the coin?
Under my understanding, I think hashed public key just represents the recipient like the address, not being related to some tasks of permitting coins.
ScriptPubKey seems like it doesn't have the network information because hashed public key doesn't have it.
Blockchain sees the ScriptPubKey as the address of recipient but how does Blockchain distinguish the kind of network?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
|
|
|
See the illustraion depicting a block and a blockchain, drawn by Youngmin Park, in the following link:
|
|
|
|
|
|
See the illustraion depicting a block and a blockchain, drawn by Youngmin Park(Youngmtool), in the following link:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*illustraion typo, and a TxIn IS an input. This is not a different thing.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@NicolasDorier
Thanks. Fixed. But of TxIn and input. That's the point I asked to @nopara73
But I'm still confused by the terms for them.
Hope you review this thread from top one by one and give the opinion:
#94
And if you don't mind, I want to hear about above question of ScriptPubKey.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|