I'm just not aware at all where those indexes comes from and into the play regarding my full node. I mean, someone said I can use different index to generate a different address with a different PK other than the same PK that generated any of the 2 bc1 addresses I generated before. I just want to know how.
I am not completely sure, but i believe this does not work with
getnewaddress in core.
Other wallets definitely offer that option (e.g. electrum), but afaik core doesn't.
Ok, no problem...
I don't have any specific reason. These 3 addresses were created back when I started learning about the bitcoin protocol. I was experimenting, testing, learning. And I always kept them but never noticed they were sharing the same PK because I've only used one of them to send payments out. The other address starting with 1, never used it and the bech32 is one of the addresses where I old some BTC, so I never used their PKs that many times to notice they were the same.
My personal recommendation would be to either 1) decide which type of addresses you want and only use that or 2) create a seperate wallet for each type of addresses.
That probably would be the easiest approach.
That's what I will probably do. I'll use option 2. A different wallet to each type of address if I need more than one address type. Thanks for the suggestion.
Why I want to save the PKs with the addresses?? Well, to know which address belongs to which address.
But is there a reason for that?
What do you need this for? If you want to spend from a specific address, your wallet can take care of it.
Same applies to signing messages from a specific address.
If you want to export the private key of a specific address, you can also do so with a simple command.
If this is for a backup, the seed or the wallet file would be a more convenient way to backing it up.
Is there any specific reason for that ?
The reason is the one I already said. I like more the ideia of a single PK per address, instead of a PK for 3 addresses. That way I will always know to which address corresponds each PK. Easier to back up, easier to organise if I have several addresses and/or several nodes, etc.
I feel more comfortable that way. That's all.
About derivation paths, I think my knowledge about the subject is enough to answer to that. In other words, I don't know what are derivation paths technically or how to get them or how to use them.
Since all private keys are derived from a single seed, a path used to do so.
It starts with the index 0 and increases for each derived private key. So, the first time you call
getnewaddress you get the address from the private key at index
0, the second one at index
1, and so on..
Ok, I think I understand. This derivation path seems to be something more at the level of bitcoin core source code when generating addresses.
One more thing I might not have made clear is that I tend to avoid using too many applications. I have never user Electrum to send payments anywhere. I always try to do it from my nodes (1 online and 1 offline).
This serves, at least, 2 purposes. Some security/privacy and the learning process.
I like to think that in crypto, you should suspect of everything. But this is an whole different subject. I just want to say that I try to use the least applications possible to what I need to do. That reduces risks of malware, trojans, keyloggers, phishing and other types of intrusion and privacy violations.
I thought you are planning on creating a web application or something similar, that's why i mentioned that way of storing relevant information.
IMO you shouldn't worry too much about it.
Storing private keys together with an address doesn't make much sense. If you are planning to do something with those private keys, that obviously would be something completely different.
But for normal usage, what is the problem with only using 1 address type or using different wallets for different types or just using different types of address derived from the same private key ?
The reason I created this thread is not directly related to any web site or application. But I'm doing something on that field. But I still need to learn a lot, mostly about addresses wallets, scriptsigs and all that stuff. At least for the learning purpose. I'm still a noob in this, so one good way to learn is to get involved in some project. It makes me to search, read, ask, experiment, etc.