Bitcoin Forum
April 23, 2024, 11:05:06 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 3 »  All
  Print  
Author Topic: Collisions on private addresses? Balances?  (Read 527 times)
marksanchez5544 (OP)
Newbie
*
Offline Offline

Activity: 28
Merit: 3


View Profile
June 28, 2022, 08:54:58 PM
Merited by NotATether (1)
 #1

I have seen that there are

1,461,501,637,330,902,918,203,684,832,716,283,019,655,932,542,976

Bitcoin addresses.

If I wrote a computer program that generates private btc addresses and then generated the public address, if that public address has a balance, and if I then imported that private address into a wallet, could I claim the money on that wallet?

How many addresses would nee to be checked before I found an address with a balance?

Thanks.
1713870306
Hero Member
*
Offline Offline

Posts: 1713870306

View Profile Personal Message (Offline)

Ignore
1713870306
Reply with quote  #2

1713870306
Report to moderator
1713870306
Hero Member
*
Offline Offline

Posts: 1713870306

View Profile Personal Message (Offline)

Ignore
1713870306
Reply with quote  #2

1713870306
Report to moderator
In order to get the maximum amount of activity points possible, you just need to post once per day on average. Skipping days is OK as long as you maintain the average.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713870306
Hero Member
*
Offline Offline

Posts: 1713870306

View Profile Personal Message (Offline)

Ignore
1713870306
Reply with quote  #2

1713870306
Report to moderator
1713870306
Hero Member
*
Offline Offline

Posts: 1713870306

View Profile Personal Message (Offline)

Ignore
1713870306
Reply with quote  #2

1713870306
Report to moderator
Zaguru12
Hero Member
*****
Offline Offline

Activity: 672
Merit: 855



View Profile
June 28, 2022, 09:14:42 PM
Merited by NotATether (2), Cookdata (2), Hyphen(-) (2), Asiska02 (2), Frankolala (2)
 #2

It seems almost impossible in bitcoin to have collision of private keys but since generation is base on random numbers theoretically it is possible. If it then happens as such both original and colliding owner of the address can spend funds in the wallet

Check here for more clarification
https://crypto.stackexchange.com/questions/33821/how-to-deal-with-collisions-in-bitcoin-addresses#:~:text=Since%20Bitcoin%20addresses%20are%20basically,money%20sent%20to%20that%20address.

.BEST..CHANGE.███████████████
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
███████████████
..BUY/ SELL CRYPTO..
marksanchez5544 (OP)
Newbie
*
Offline Offline

Activity: 28
Merit: 3


View Profile
June 28, 2022, 09:23:39 PM
 #3

Thanks for the answer.

Is it true if that were to happen, all I need is the private key to spend the funds?

Thanks
Zaguru12
Hero Member
*****
Offline Offline

Activity: 672
Merit: 855



View Profile
June 28, 2022, 09:37:46 PM
 #4

Thanks for the answer.

Is it true if that were to happen, all I need is the private key to spend the funds?

Thanks
I don't have that much knowledge on this but base on my study. Yes you can spend the funds if a collision happens

.BEST..CHANGE.███████████████
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
███████████████
..BUY/ SELL CRYPTO..
LoyceMobile
Hero Member
*****
Offline Offline

Activity: 1649
Merit: 686


LoyceV on the road. Or couch.


View Profile WWW
June 28, 2022, 09:40:00 PM
 #5

If I wrote a computer program that generates private btc addresses and then generated the public address, if that public address has a balance, and if I then imported that private address into a wallet, could I claim the money on that wallet?
Yes. And by all means: try it! Convince yourself how secure Bitcoin is, you'll never find a fixed address that was properly generated.

LoyceV on the road Advertise here for LN Don't deal with this account (exception)
Advertise here for LN Tip my kids
My useful topics: Meritt & Trust & Moreee Art Advertise here for LN Forum Features
Upgrade00
Legendary
*
Offline Offline

Activity: 2016
Merit: 2170


Professional Community manager


View Profile WWW
June 28, 2022, 09:59:40 PM
 #6

Is it true if that were to happen, all I need is the private key to spend the funds?
Private keys are the means by which transactions are signed from corresponding addresses on the blockchain which were generated from they xpriv key. So, with the private keys you will be able to spend funds from that address.

If it were possible to generate private keys and public keys which has a balance on it, then it would not have been worth it, as the network would haveko value.

.BEST..CHANGE.███████████████
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
███████████████
..BUY/ SELL CRYPTO..
tranthidung
Legendary
*
Offline Offline

Activity: 2254
Merit: 3969


Farewell o_e_l_e_o


View Profile WWW
June 29, 2022, 01:31:47 AM
 #7

If I wrote a computer program that generates private btc addresses and then generated the public address
You're missing a point:

Private address to public address, there is no process like this.

It's one-way flow from k > K > A
Private key (Elliptic Curve Multiplication: one-way) > Public key (Hash-function: one-way) > Public address

It is one-way and irreversible process as you can read more in Chapter 3: Key, addresses in Mastering Bitcoin book

▄▄███████▄▄
▄██████████████▄
▄██████████████████▄
▄████▀▀▀▀███▀▀▀▀█████▄
▄█████████████▄█▀████▄
███████████▄███████████
██████████▄█▀███████████
██████████▀████████████
▀█████▄█▀█████████████▀
▀████▄▄▄▄███▄▄▄▄████▀
▀██████████████████▀
▀███████████████▀
▀▀███████▀▀
.
 MΞTAWIN  THE FIRST WEB3 CASINO   
.
.. PLAY NOW ..
witcher_sense
Legendary
*
Offline Offline

Activity: 2310
Merit: 4313

🔐BitcoinMessage.Tools🔑


View Profile WWW
June 29, 2022, 05:51:20 AM
Last edit: June 29, 2022, 06:20:01 AM by witcher_sense
 #8

I have seen that there are

1,461,501,637,330,902,918,203,684,832,716,283,019,655,932,542,976

Bitcoin addresses.
There are 2160 P2PKH addresses + 2160 P2SH addresses + 2160 P2WPKH addresses + 2256 P2WSH addresses + 2256 P2TR addresses, which is the number that greatly exceeds the number of possible private keys (slightly less than 2256).

What about P2PK? Smiley
Why do you need a separate address format, if you'are paying directly to a public key (as a name suggests)?

If I wrote a computer program that generates private btc addresses and then generated the public address, if that public address has a balance, and if I then imported that private address into a wallet, could I claim the money on that wallet?
You don't need a special program to generate private and public keys, any bitcoin wallet can do the trick. The odds of you accidentally finding a private key with a balance are extremely slim, but no one can stop you from trying. However, keep in mind that stealing someone else's coins is to be considered a crime in most jurisdictions.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
PowerGlove
Hero Member
*****
hacker
Offline Offline

Activity: 507
Merit: 3952



View Profile
June 29, 2022, 06:04:45 AM
Last edit: June 29, 2022, 06:28:41 AM by PowerGlove
 #9

There are 2160 P2PKH addresses + 2160 P2SH addresses + 2160 P2WPKH addresses + 2256 P2WSH addresses + 2256 P2TR addresses, which is the number that greatly exceeds the number of possible private keys (slightly less than 2256).

What about P2PK? Smiley

Why do you need a separate address format, if you'are paying directly to a public key (as a name suggests)?

P2PK was before my time, but wasn't it just the Base58 encoding of the public key? So, if you're adding up all the different ways that you can specify an "address", doesn't it belong in your sum?
marksanchez5544 (OP)
Newbie
*
Offline Offline

Activity: 28
Merit: 3


View Profile
June 29, 2022, 06:31:40 AM
 #10

I know this is all theory, but it seems to me that if btc wallets just reply on you not matching the private key, then it's a lack of security surely, as I know the fastest super computer on the planet can cycle through the combinations in 9 days.
nc50lc
Legendary
*
Offline Offline

Activity: 2394
Merit: 5526


Self-proclaimed Genius


View Profile
June 29, 2022, 07:26:19 AM
Merited by Chikito (1), PowerGlove (1)
 #11

I have seen that there are

1,461,501,637,330,902,918,203,684,832,716,283,019,655,932,542,976

Bitcoin addresses.

If I wrote a computer program that generates private btc addresses and then generated the public address, if that public address has a balance, and if I then imported that private address into a wallet, could I claim the money on that wallet?

How many addresses would nee to be checked before I found an address with a balance?
The number you've given is merely based on the HASH160 of the public key that is 160bit which is correct, but that's merely for addresses that relies on that PubkeyHash.
There are other address types out there, anyways, that's not the important part of this reply.

The Bitcoin address generation starts from Private key if you want to be able to spend its funds so what you need to bruteforce are private keys.
Which has roughly 2^256 combinations or
115,792,089,237,316,195,423,570,985,008,687,907,853,269,984,665,640,564,039,457,584,007,913,129,639,936
But since some of them are invalid, the number "shrinks" to:
115,792,089,237,316,195,423,570,985,008,687,907,852,837,564,279,074,904,382,605,163,141,518,161,494,336
If you can theoretically bruteforce even 1% of that, you "may" be able to find one with funds.

-snip- as I know the fastest super computer on the planet can cycle through the combinations in 9 days.
Maybe yes (for 2^160), but they can't spend it since they've bruteforced addresses, not private keys.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
marksanchez5544 (OP)
Newbie
*
Offline Offline

Activity: 28
Merit: 3


View Profile
June 29, 2022, 03:52:16 PM
Last edit: June 29, 2022, 04:05:28 PM by marksanchez5544
 #12

Hi, is the hash 160 for legacy addresses?

The figures above are quoted to cycle through the entire range of addresses from start to finish.

It may be a case that your my particular address gets cycled in the first hour.
PowerGlove
Hero Member
*****
hacker
Offline Offline

Activity: 507
Merit: 3952



View Profile
June 30, 2022, 02:22:42 AM
Merited by nc50lc (1)
 #13

Hi, is the hash 160 for legacy addresses?

That's a little beside the point. As nc50lc said, if you want to be able spend what you find, then you need to search the "private key" space and not the "address" space.

Let's consider "legacy" P2PKH addresses for the moment. To create one you have to choose a number between 1 and 115792089237316195423570985008687907852837564279074904382605163141518161494336.

Then you take this number and do some irreversible math on it (elliptic curve cryptography) to produce another number.

Then you take this number and do some more irreversible math on it (cryptographic hash) to produce the final "address".

If you try to search for non-empty addresses by "cheating" and not doing the full address derivation, then when you find an address that has money in it, you won't be able to spend it (because you don't have the first number, the private key).

The figures above are quoted to cycle through the entire range of addresses from start to finish.

No, those figures are for illustrating how much harder searching a space gets as you add bits. The takeaway should be that if you can search a 2^160 space in 9 days, then searching a 2^256 space will take you roughly 2 octillion years (~140 quadrillion times longer than the age of the universe).

It may be a case that your my particular address gets cycled in the first hour.

That's true, but 2^256 is a massive search space. It's tempting to visualize it as a line and think that there "must" be some addresses near the beginning of that line, but with a space this big "near" can still be really, really far. If you've selected your private key at random, you have nothing to worry about.
nc50lc
Legendary
*
Offline Offline

Activity: 2394
Merit: 5526


Self-proclaimed Genius


View Profile
June 30, 2022, 03:23:39 AM
 #14

Hi, is the hash 160 for legacy addresses?
Yes, it's one of the address type that uses "HASH160" or RIPEMD160[SHA256(PubKey)] for P2PKH.
P2SH also uses HASH160 of the redeem script, P2WPKH also uses it, the rest of the steps are just difference in encoding.
So when pointlessly bruteforcing addresses, you can derive those address types from each 160bit result.

The figures above are quoted to cycle through the entire range of addresses from start to finish.
If I wrote a computer program that generates private btc addresses and then generated the public address,
There's no "private BTC address" and "public address".
Only "Private Key" and its "Public Key" pair, then the "Bitcoin address" generated from the public key.
It's a one way process "PrvKey->PubKey->Address", not the other way around.

As an analogy, let' use a "lock" and "key" scenario:
  • Let the "lock" be the HASH160.
  • Let the "key" be the Private Key.
  • In your scenario, your theoretical computer program cycles through all the "locks" which can only unlocked by the "key".
  • Even if you can generate all the locks, it's pointless since you can't unlock them without their keys.
  • So, if you want "collision", you need search through the keys which have a tremendously larger search space than the locks.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
marksanchez5544 (OP)
Newbie
*
Offline Offline

Activity: 28
Merit: 3


View Profile
June 30, 2022, 06:08:30 AM
 #15

I understand all of the above, but the point I am making is this.

I can generate a private key, and from there I can generate a public address, from that same private key.

If I did this enough times, and it may take forever, eventually I will match a public address, and I will have the private key from it, so I can claim the balance if it had one, in theory?
PowerGlove
Hero Member
*****
hacker
Offline Offline

Activity: 507
Merit: 3952



View Profile
June 30, 2022, 06:18:34 AM
Last edit: June 30, 2022, 07:25:00 AM by PowerGlove
 #16

I understand all of the above, but the point I am making is this.

I can generate a private key, and from there I can generate a public address, from that same private key.

If I did this enough times, and it may take forever, eventually I will match a public address, and I will have the private key from it, so I can claim the balance if it had one, in theory?

Yup, that's pretty much all there is to it.

Edit: Of course, it's not realistic to undertake this search and expect results, but it's possible, both in theory and in practice. The only thing protecting any given bitcoin address (ignoring exotic redeem scripts) from unauthorized spending is lack of knowledge about the private key, there are no other protections in place. That's why it's so important to keep your private key(s) safe.
marksanchez5544 (OP)
Newbie
*
Offline Offline

Activity: 28
Merit: 3


View Profile
June 30, 2022, 02:52:20 PM
Merited by PowerGlove (1)
 #17

Interesting conversation, thanks everyone, now to build the app and try. Lol
PowerGlove
Hero Member
*****
hacker
Offline Offline

Activity: 507
Merit: 3952



View Profile
July 01, 2022, 04:34:45 PM
 #18

If I wrote a computer program that generates private btc addresses and then generated the public address, if that public address has a balance, and if I then imported that private address into a wallet, could I claim the money on that wallet?

Interesting conversation, thanks everyone, now to build the app and try. Lol

Because this task is so computationally infeasible and therefore harmless to try, I'll spare you the morality lecture and just say that I like your methodology. IMHO, getting some code down is the best way to learn about something. Good luck!
marksanchez5544 (OP)
Newbie
*
Offline Offline

Activity: 28
Merit: 3


View Profile
July 02, 2022, 08:58:33 PM
Merited by PowerGlove (1)
 #19

Lol.
Ok so started to build the app. First got 12 million computations per day as a test, this generates the private key, and public key etc. I now compare that to a database of 60000 known public keys and balances.

Day 3, improved the code somewhat. Now the same app is running at 500 million computations per 24 hrs, comparing the generated output against a dBASE of 60000 known balances addresses

So my computations are now 500 million * 60000 per 24hrs. The numbers is to big to calculate.
This is running on a Windows 7 pc icore 5.

Let's see what it comes up with in a day, a week, a year.

I know the numbers are huge.
PowerGlove
Hero Member
*****
hacker
Offline Offline

Activity: 507
Merit: 3952



View Profile
July 03, 2022, 02:47:38 AM
Last edit: July 03, 2022, 01:11:04 PM by PowerGlove
 #20

Lol.
Ok so started to build the app. First got 12 million computations per day as a test, this generates the private key, and public key etc. I now compare that to a database of 60000 known public keys and balances.

Day 3, improved the code somewhat. Now the same app is running at 500 million computations per 24 hrs, comparing the generated output against a dBASE of 60000 known balances addresses

So my computations are now 500 million * 60000 per 24hrs. The numbers is to big to calculate.
This is running on a Windows 7 pc icore 5.

Let's see what it comes up with in a day, a week, a year.

I know the numbers are huge.

Take a merit for following through on your plan and for being hardcore enough to still be running Windows 7 Grin

Sounds like you're having fun, keep at it! I would double-check your numbers though, they seem a little high for a core i5...
Pages: [1] 2 3 »  All
  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!