Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: nondormomai on January 20, 2024, 08:47:33 AM



Title: Generate Prikeys Pubkeys and address using an old computer without www net?
Post by: nondormomai on January 20, 2024, 08:47:33 AM
Hi,

it is possibile to generate private keys, then public keys, then all addresses set, just using an old computer (windows, mac, or linux) which is not connected to the www net?

if it is, can you let me know the right procedure?

Generally speaking, I guess creating a private key is not particularly stressful for old computers bought on 2012, is it?


Thank you for aswering me.


Title: Re: Generate private keys on computer without
Post by: OmegaStarScream on January 20, 2024, 08:48:53 AM
Yes, that shouldn't be a very resource-consuming task. You can do it either by downloading an offline version of bitaddress[1] or by simply downloading a noncustodial wallet like Electrum[2] on another device and then moving it to your laptop.

[1] https://github.com/pointbiz/bitaddress.org
[2] https://electrum.org/#download


Title: Re: Generate private keys on computer without
Post by: ranochigo on January 20, 2024, 08:50:24 AM
You don't need an internet connection to use any Desktop Wallet (Bitcoin Core, Electrum etc). You would be able to install and use the different clients normally, as you would on a normal computer. The process to generate an address using the clients differs, and it would be helpful if you could specify which wallet are you intending to use.

Yes, that shouldn't be a very resource-consuming task. You can do it either by downloading an offline version of bitaddress[1].

[1] https://github.com/pointbiz/bitaddress.org

I personally don't recommend using any Javascript wallet, especially one that isn't in active development.


Title: Re: Generate private keys on computer without
Post by: nondormomai on January 20, 2024, 09:20:09 AM
Yes, that shouldn't be a very resource-consuming task.


You don't need an internet connection to use any Desktop Wallet (Bitcoin Core, Electrum etc).

I personally don't recommend using any Javascript wallet, especially one that isn't in active development.



Thank you.

So, I am supposed to download something.....

Is not possibile to generate them only with terminal?


Title: Re: Generate private keys on computer without
Post by: ranochigo on January 20, 2024, 09:26:35 AM
Thank you.

So, I am supposed to download something.....

Is not possibile to generate them only with terminal?
It is possible, but just a hassle as compared to downloading Bitcoin Core and generating it yourself. Assuming that your OS ships with OpenSSL, you can use OpenSSL to generate an ECDSA keypair, then convert it into a Bitcoin address with a WIF private key. However, this would require you to understand exactly what you are doing with your terminal, or risk losing your funds.

Bitcoin Core or any other wallets does this for you in an elegant UI, with appropriate sanity checking to ensure that your Bitcoin addresses are properly generated. Given that, would you still insist to generate them manually using OpenSSL?


Title: Re: Generate private keys on computer without
Post by: nondormomai on January 20, 2024, 10:45:37 AM
Thank you.

So, I am supposed to download something.....

Is not possibile to generate them only with terminal?
It is possible, but just a hassle as compared to downloading Bitcoin Core and generating it yourself. Assuming that your OS ships with OpenSSL, you can use OpenSSL to generate an ECDSA keypair, then convert it into a Bitcoin address with a WIF private key. However, this would require you to understand exactly what you are doing with your terminal, or risk losing your funds.

Bitcoin Core or any other wallets does this for you in an elegant UI, with appropriate sanity checking to ensure that your Bitcoin addresses are properly generated. Given that, would you still insist to generate them manually using OpenSSL?

Thank you.
Having care of my sanity :), your suggestion is fine.

But, let me give you a more complete view of the problem. My question is: can an offline computer generate the proven keys, the public keys and finally the addresses?

If so, I imagine that this practice is more secure than the same process on an online machine, or is this an erroneous thought?

Thank you


Title: Re: Generate private keys on computer without
Post by: ranochigo on January 20, 2024, 10:52:05 AM
Thank you.
Having care of my sanity :), your suggestion is fine.

But, let me give you a more complete view of the problem. My question is: can an offline computer generate the proven keys, the public keys and finally the addresses?

If so, I imagine that this practice is more secure than the same process on an online machine, or is this an erroneous thought?

Thank you
Sanity check in Computer Science terms is a bit different from what sanity literally means.

As I have already answered previously, you do not require an internet connection to generate private keys, public keys or their addresses. Again, so long as your OS has the required dependencies or the softwares (Electrum comes preinstalled in Tails), you can generate ECDSA private keypairs and your addresses. You can even do so using a pen and paper.

The security that your setup provides would be limited by your exposure of the keys to the internet. Generating your keys offline before transferring it to another device connected to the internet provides no additional security whatsoever. The same applies if your computer is connected to the internet before or after the generation of the keys.


Title: Re: Generate Prikeys Pubkeys and address using an old computer without www net?
Post by: NotATether on January 20, 2024, 11:03:41 AM
Generally speaking, I guess creating a private key is not particularly stressful for old computers bought on 2012, is it?

Not at all. In fact you can even do it on 2002 computers.

Creating a private key means you only need to generate 256 random bits = 64 random bytes, and elliptic curve cryptography is light enough that the process of generating one key should not even use noticeable amounts of resources.

@ranochigo your bbcode formatting is broken

Thank you.

So, I am supposed to download something.....

Is not possibile to generate them only with terminal?

There are quite a few scripts that can do this, for starters you can check out ofek/bit on Github or my own ZPyWallet.


Title: Re: Generate private keys on computer without
Post by: ABCbits on January 20, 2024, 01:03:40 PM
If so, I imagine that this practice is more secure than the same process on an online machine, or is this an erroneous thought?

No. What matter most is the RNG source used by script/wallet software you use.

Thank you.
Having care of my sanity :), your suggestion is fine.

But, let me give you a more complete view of the problem. My question is: can an offline computer generate the proven keys, the public keys and finally the addresses?

If so, I imagine that this practice is more secure than the same process on an online machine, or is this an erroneous thought?

Thank you
Sanity check in Computer Science terms is a bit different from what sanity literally means.

As I have already answered previously, you do not require an internet connection to generate private keys, public keys or their addresses. Again, so long as your OS has the required dependencies or the softwares (Electrum comes preinstalled in Tails), you can generate ECDSA private keypairs and your addresses.

FWIW Debian ISO file also include Electrum. To be specific, debian-12.4.0-amd64-BD-2 include that (based on it's list file[1]). Or you could just include needed application/script on DVD or flash drive used to install the OS on offline computer.

[1] https://cdimage.debian.org/debian-cd/current/amd64/list-bd/ (https://cdimage.debian.org/debian-cd/current/amd64/list-bd/)


Title: Re: Generate private keys on computer without
Post by: Findingnemo on January 20, 2024, 02:35:54 PM
My question is: can an offline computer generate the proven keys, the public keys and finally the addresses?

If so, I imagine that this practice is more secure than the same process on an online machine, or is this an erroneous thought?

Thank you

Wallet software no need internet connection to generate the wallet which will give you the private keys of the addresses created in the wallet and also the public keys corresponds to every address.

Bitcoin addresses are nothing but hashed version of public keys which you can safely generate in an complete offline device.

You thought isn't new, and its been the most recommended way of creating a wallet which is generally called as Air-gapped Wallet, a wallet generated and used to sign transactions to eliminate potential threats like malware.


Title: Re: Generate private keys on computer without
Post by: LoyceV on January 20, 2024, 02:36:07 PM
Is not possibile to generate them only with terminal?
You can:
A privatekey (hex upppercase)
Code:
< /dev/urandom tr -cd "A-F0-9" | head -c 64 ; echo
But you'd better know what you're doing when manually creating and backing up private keys. Mistakes are easy to make.


Title: Re: Generate private keys on computer without
Post by: nondormomai on January 21, 2024, 09:05:47 AM
Is not possibile to generate them only with terminal?
You can:
A privatekey (hex upppercase)
Code:
< /dev/urandom tr -cd "A-F0-9" | head -c 64 ; echo
But you'd better know what you're doing when manually creating and backing up private keys. Mistakes are easy to make.


Tank yo all.

I will try with few sats.


Title: Re: Generate private keys on computer without
Post by: BlackHatCoiner on January 21, 2024, 10:25:11 AM
If so, I imagine that this practice is more secure than the same process on an online machine, or is this an erroneous thought?
It is safer in the sense that an Internet connected computer is prone to be compromised by an attacker via the Internet, whereas it is simply physically impossible for this to happen on an airgapped device.

I will try with few sats.
My instinct tells me that you're about to make a mistake. Would you like to try out testnet (https://en.bitcoin.it/wiki/Testnet) first? I can spare you a few testnet sats.


Title: Re: Generate private keys on computer without
Post by: LoyceV on January 21, 2024, 10:35:34 AM
I will try with few sats.
My instinct tells me that you're about to make a mistake.
Or at least post all the steps taken here, for scrutiny?


Title: Re: Generate private keys on computer without
Post by: ABCbits on January 22, 2024, 11:23:44 AM
Is not possibile to generate them only with terminal?
You can:
A privatekey (hex upppercase)
Code:
< /dev/urandom tr -cd "A-F0-9" | head -c 64 ; echo
But you'd better know what you're doing when manually creating and backing up private keys. Mistakes are easy to make.


Tank yo all.

I will try with few sats.

Make sure the private key generated within valid range. It should from 1 to FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE BAAEDCE6 AF48A03B BFD25E8C D0364140. Not all software/library throw error or silently perform modulo if you enter private key outside that range.


Title: Re: Generate private keys on computer without
Post by: LoyceV on January 22, 2024, 12:58:26 PM
Make sure the private key generated within valid range. It should from 1 to FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE BAAEDCE6 AF48A03B BFD25E8C D0364140. Not all software/library throw error or silently perform modulo if you enter private key outside that range.
Getting 31 Fs in a row has a chance of 1 in 21267647932558653966460912964485513216 (https://www.wolframalpha.com/input?i=16%5E31%3D). If you hit that, it's more likely something else went wrong than that it's created randomly.


Title: Re: Generate private keys on computer without
Post by: albert0bsd on January 22, 2024, 02:59:28 PM
Getting 31 Fs in a row has a chance of 1 in 21267647932558653966460912964485513216 (https://www.wolframalpha.com/input?i=16%5E31%3D). If you hit that, it's more likely something else went wrong than that it's created randomly.

I agree with this, like a CPU / OS error / Cosmic beam.

In that case any person with some common sense will generate another key