Bitcoin Forum
May 05, 2024, 01:45:46 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: What is pubkey?  (Read 326 times)
wsxdrfv (OP)
Jr. Member
*
Offline Offline

Activity: 405
Merit: 5


View Profile WWW
February 21, 2018, 08:00:07 AM
 #1

python script GenesisH0, GenesisBlockZero, both does not work with newest bitcoin(0.15.1)/litecoin source.

When use those and compile, those just spit out error at assert line in chainparams.cpp script.

Those uses pubkey variable, so it means public key, right?

It just assume that key or provide, can I use it as-is?

Or how can I know my public key?

Should I generate it? How?
"In a nutshell, the network works like a distributed timestamp server, stamping the first transaction to spend a coin. It takes advantage of the nature of information being easy to spread but hard to stifle." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714916746
Hero Member
*
Offline Offline

Posts: 1714916746

View Profile Personal Message (Offline)

Ignore
1714916746
Reply with quote  #2

1714916746
Report to moderator
1714916746
Hero Member
*
Offline Offline

Posts: 1714916746

View Profile Personal Message (Offline)

Ignore
1714916746
Reply with quote  #2

1714916746
Report to moderator
1714916746
Hero Member
*
Offline Offline

Posts: 1714916746

View Profile Personal Message (Offline)

Ignore
1714916746
Reply with quote  #2

1714916746
Report to moderator
bob123
Legendary
*
Offline Offline

Activity: 1624
Merit: 2481



View Profile WWW
February 25, 2018, 01:58:11 PM
Merited by achow101 (2), ABCbits (2), DarkStar_ (2), TechPriest (1)
 #2

python script GenesisH0, GenesisBlockZero, both does not work with newest bitcoin(0.15.1)/litecoin source.
When use those and compile, those just spit out error at assert line in chainparams.cpp script.
Those uses pubkey variable, so it means public key, right?
It just assume that key or provide, can I use it as-is?

You might start off with what you are trying to accomplish.
For me this is pretty confusing. Could you provide more information about what you did and what error message you got?



Or how can I know my public key?

The public key is derived from the private key.
pubK = G * privK
with pub = Public key; priv = private key; G = set of coordinates (x,y) on the secp256k1 elliptic curve
For more information about elliptic curve multiplication: https://en.wikipedia.org/wiki/Elliptic_Curve_DSA



Should I generate it? How?

You definetely need to generate a public key if you want to receive payments.
You either use a wallet/script/tool to create a priv-/pub keypair or go code it yourself. What are you trying to accomplish?

wsxdrfv (OP)
Jr. Member
*
Offline Offline

Activity: 405
Merit: 5


View Profile WWW
February 25, 2018, 02:56:55 PM
 #3

python script GenesisH0, GenesisBlockZero, both does not work with newest bitcoin(0.15.1)/litecoin source.
When use those and compile, those just spit out error at assert line in chainparams.cpp script.
Those uses pubkey variable, so it means public key, right?
It just assume that key or provide, can I use it as-is?

You might start off with what you are trying to accomplish.
For me this is pretty confusing. Could you provide more information about what you did and what error message you got?



Or how can I know my public key?

The public key is derived from the private key.
pubK = G * privK
with pub = Public key; priv = private key; G = set of coordinates (x,y) on the secp256k1 elliptic curve
For more information about elliptic curve multiplication: https://en.wikipedia.org/wiki/Elliptic_Curve_DSA



Should I generate it? How?

You definetely need to generate a public key if you want to receive payments.
You either use a wallet/script/tool to create a priv-/pub keypair or go code it yourself. What are you trying to accomplish?

Thx for reply.

So eventually I want to generate genesis block and make it work.

Some thread replies recommend using GenesisH0 at github ( https://github.com/lhartikk/GenesisH0 )for generate genesis block. So I tried, but when run it, it automatically provide some pubkey. I meant can I use as-is for my script? And where at my source code this pubkey should I input?

But anyway, these hash and nonce value got by GenesisH0 seems not work. When I input them to my code, spit out errors. (same assert errors when wrong hash value was input)

So I just used printf method to get hash, merkleroot value, this works, now I passed this step.

Now after this, I need to create genesis block, all the old codes does not work, and also need to pass "CheckProofOfWork" function at "pow.cpp" file.

I am stuck here. I used "CheckProofOfWork" function at chainparams.cpp with #include "pow.h" above, but compile spit out errors. Says there is no definition of CheckProofOfWork, maybe this is C++'s link problem, but I don't know how to solve this?

And is this right for use this Check... function to generating valid genesis block?
nullius
Copper Member
Hero Member
*****
Offline Offline

Activity: 630
Merit: 2610


If you don’t do PGP, you don’t do crypto!


View Profile WWW
February 26, 2018, 01:40:21 AM
Merited by ABCbits (1)
 #4

A public key is a large numerical value that is used to encrypt data. The key can be generated by a software program. It is provided by a designated authority and made available to everyone to send crypto.

A private key is for the owner and should never be shared!!!!!!!

WRONG INFORMATION, at least in the context of Bitcoin (and in some parts entirely incorrect).

The public keys in Bitcoin are used to sign data, not to encrypt data.  A digital signature from a private key is verifiable with a public key.  This provides authorization for a spend.

The key is not provided by a “designated authority”.  Not in Bitcoin, and not in any other reasonably designed public-key cryptosystem.  (In some other systems, such as TLS, an “authority” may certify public keys as being connected to a certain identity, such as a website address or (for EV) a corporate name; however, a TLS certificate authority does not generate the keys.)

The public key isn’t just a “large numerical value”.  It has specific properties which relate it to the private key.  For Bitcoin, read up on secp256k1, the ECDSA curve parameters used by Bitcoin.

The only correct line in this post:  A private key must never be shared.  The security of the whole system depends on the secrecy of the private key.  (This is an application of Kerckhoffs’ Principle.)



OP, you need to explain more clearly what you want.  bob123 said this already; and your followup post did little to elucidate.

Anyway, I don’t anticipate that I will follow this thread.  I only posted the foregoing because I saw incorrect factual statements, and there is already too much misinformation about there.  No need for newbies and learners to get confused by an authoritative-sounding wrong statement concerning the basic facts about public keys.  Happyniall, please don’t pretend to give answers unless you actually know what you’re talking about.  You will mislead other people.  Why bother?  Do you think anybody will give you credit for incorrect information in a technical forum?

wsxdrfv (OP)
Jr. Member
*
Offline Offline

Activity: 405
Merit: 5


View Profile WWW
February 26, 2018, 07:24:48 AM
 #5

So how to get key for genesisOutputScript variable in chainparams.cpp?

And is this public key of bitcoin?

const CScript genesisOutputScript = CScript() << ParseHex("dfalkdfjlefkjedf.............") << OP_CHECKSIG;

achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6581


Just writing some code


View Profile WWW
February 26, 2018, 04:06:34 PM
 #6

So how to get key for genesisOutputScript variable in chainparams.cpp?
You generate it using whatever software you want. Most people use openssl. You could even just use an unmodified version of Bitcoin Core to do it. It doesn't matter what the public key is because that output is not spendable unless you have changed stuff in validation.cpp to make it spendable. Hell, the script could just be garbage too.

And is this public key of bitcoin?
It is an output script that contains a public key.

wsxdrfv (OP)
Jr. Member
*
Offline Offline

Activity: 405
Merit: 5


View Profile WWW
February 27, 2018, 12:58:27 AM
 #7

So how to get key for genesisOutputScript variable in chainparams.cpp?
You generate it using whatever software you want. Most people use openssl. You could even just use an unmodified version of Bitcoin Core to do it. It doesn't matter what the public key is because that output is not spendable unless you have changed stuff in validation.cpp to make it spendable. Hell, the script could just be garbage too.
 
Thanks.

Then how to make it spendable? What I have to changed in validation.cpp?
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!