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.
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.
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 ?
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..
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 ?