Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: LicensedCrab on December 08, 2014, 09:01:44 PM



Title: Checking addresses against an MPK
Post by: LicensedCrab on December 08, 2014, 09:01:44 PM
I would like to make a script that checks certain addresses against an MPK to verify you own the addresses. If this were possible I was thinking there are 2 ways it could work. 1, generate addresses until one of them equals the address you are checking or 2, just be able to check if the address belongs to the MPK. Is the 2nd one even possible? Because that is the more desirable option.


Title: Re: Checking addresses against an MPK
Post by: DannyHamilton on December 08, 2014, 09:13:57 PM
I would like to make a script that checks certain addresses against an MPK to verify you own the addresses. If this were possible I was thinking there are 2 ways it could work. 1, generate addresses until one of them equals the address you are checking or 2, just be able to check if the address belongs to the MPK. Is the 2nd one even possible? Because that is the more desirable option.

What is an MPK?


Title: Re: Checking addresses against an MPK
Post by: LicensedCrab on December 08, 2014, 09:33:41 PM
I would like to make a script that checks certain addresses against an MPK to verify you own the addresses. If this were possible I was thinking there are 2 ways it could work. 1, generate addresses until one of them equals the address you are checking or 2, just be able to check if the address belongs to the MPK. Is the 2nd one even possible? Because that is the more desirable option.

What is an MPK?
master public key (the public key for your wallet. This is what generates all of your addresses)


Title: Re: Checking addresses against an MPK
Post by: jonald_fyookball on December 08, 2014, 09:37:08 PM
I would like to make a script that checks certain addresses against an MPK to verify you own the addresses. If this were possible I was thinking there are 2 ways it could work. 1, generate addresses until one of them equals the address you are checking or 2, just be able to check if the address belongs to the MPK. Is the 2nd one even possible? Because that is the more desirable option.

What is an MPK?
master public key (the public key for your wallet. This is what generates all of your addresses)

maybe he means master private key within the context of a deterministic wallet.
I don't know for sure but I am guessing the answer is no to #2, you'd have to
loop through various addresses, there's no way to work backwards from an address,
find the eliptic curve points and match them up to the MPK.  


Title: Re: Checking addresses against an MPK
Post by: DannyHamilton on December 08, 2014, 09:37:53 PM
Which wallet?  Are you talking about Electrum, Armory, or something else?


Title: Re: Checking addresses against an MPK
Post by: hhanh00 on December 09, 2014, 03:12:00 AM
I would like to make a script that checks certain addresses against an MPK to verify you own the addresses. If this were possible I was thinking there are 2 ways it could work. 1, generate addresses until one of them equals the address you are checking or 2, just be able to check if the address belongs to the MPK. Is the 2nd one even possible? Because that is the more desirable option.

In all likelihood, every address belongs to you after a sufficiently large number of iterations. It's because the mpk produces an address by adding to your first secret key a deterministic offset which is a hash. The later should eventually cover every possible value. It's not a proof - there could be a cycle, but it would make the hash function distinguishable from random IMO.

You don't need a script cause you own them all :)