Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: seaona on October 30, 2021, 07:03:57 AM



Title: Compile Bitcoin first version on Linux - Windres issues
Post by: seaona on October 30, 2021, 07:03:57 AM
Hi,

I'm trying to compile and run Bitcoin first version on Linux, but I am encountering some trouble in the process of installing wxWidgets. The steps I followed are the ones described on "A Dissection of Bitcoin":

1. Checkout the version I want
Code:
git checkout 4405b78d6059e536c36974088a8ed4d9f0f29898

2. Download wxWidgets

3.
Code:
cd bc/wxWidgets-2.8.12
./configure --with-msw --enable-debug --enable-debug_gdb --disable-shared
make

I get stuck when I run ./configure ... , getting this message:
Quote
"configure: error: Required windres program not found"


 I've tried to look for this package but seems that is not that easy to find for Linux. So my questions are:
  • has someone successfully compiled the first version on Linux? seems to me that the versions is "targeting" only windows users. Is this correct?
  • did you also have the same issues? how did you solve it

Thanks in advance!


Title: Re: Compile Bitcoin first version on Linux - Windres issues
Post by: ABCbits on October 30, 2021, 11:29:56 AM
1. Checkout the version I want
Code:
git checkout 4405b78d6059e536c36974088a8ed4d9f0f29898

Actually it's not first version. There are few older version which can be found at https://satoshi.nakamotoinstitute.org/code/ (https://satoshi.nakamotoinstitute.org/code/).

  • has someone successfully compiled the first version on Linux? seems to me that the versions is "targeting" only windows users. Is this correct?

Correct, very early version of Bitcoin Qt only target Windows. If you check old discussion, few user criticize Satoshi due to Windows only build.

  • did you also have the same issues? how did you solve it

I never tried running old version, but i would download compiled version and run it with WINE.


Title: Re: Compile Bitcoin first version on Linux - Windres issues
Post by: seaona on October 31, 2021, 07:19:54 AM
Thank you very much, this clarifies a lot!

In case it's useful for someone, I've research a bit and found the support for Unix was included here:
https://github.com/bitcoin/bitcoin/commit/fba40889418cb1861440a3fdccee048c69f0fb89 (https://github.com/bitcoin/bitcoin/commit/fba40889418cb1861440a3fdccee048c69f0fb89)



Title: Re: Compile Bitcoin first version on Linux - Windres issues
Post by: HCP on October 31, 2021, 10:56:47 PM
Are you talking about the "Generate Bitcoins" menu option that was in the original client? ???

I'm not aware of any "Earn Bitcoins" tab... mind you, I never used the original client, and, as it turns out, there don't seem to be many screenshots of it floating around on the internet... at least, not of the "options" menu. Only the main screen like this one:
https://talkimg.com/images/2023/11/14/zzBs8.png

(source: https://twitter.com/bit_fix/status/505105572946247680)




Title: Re: Compile Bitcoin first version on Linux - Windres issues
Post by: nc50lc on November 01, 2021, 04:11:29 AM
in first bitcoin core was "earn bitcoin" tab.
How do you think it can be still enabled?
You mean this button? (same as above)
I have 0.1 installed and the only similar name is "Generate Coins" which will use your CPU to mine blocks, thus "earn bitcoin".
It's a toggle button, clicking it will activate it (there will be a check mark) and CPU mining will run in the background.
https://i.imgur.com/S50NHlp.png (https://i.imgur.com/S50NHlp.png)

Even if you can somehow connect v0.1 to the network, that feature will work but you won't be able to win a block due to the current difficulty.


Title: Re: Compile Bitcoin first version on Linux - Windres issues
Post by: HCP on November 01, 2021, 09:30:57 PM
Question has any one check that we can minning block as minus block - like ( example -10)?
The "generate bitcoins" option just enables the builtin CPU-based miner. It doesn't do anything that a "normal" miner does and, being as old as it is, is probably not terribly well optimised.

What do you mean by a "minus block"? ??? What exactly are you trying to achieve here? ???


Title: Re: Compile Bitcoin first version on Linux - Windres issues
Post by: nc50lc on November 02, 2021, 06:09:12 AM
-snip-
Question has any one check that we can minning block as minus block - like ( example -10)?
Blockchain starts at the genesis block, I don't think you can mine blocks further below that.
Do you have any reference on use-cases where there's a -10 block height in a blockchain?

Anyways, this seems off-topic to the OP, you might need to start a new thread for that topic.


Title: Re: Compile Bitcoin first version on Linux - Windres issues
Post by: vjudeu on November 02, 2021, 08:17:39 AM
Quote
Blockchain starts at the genesis block, I don't think you can mine blocks further below that.
To mine -1 block or earlier, you need SHA-256 collision. You can replace 64-rounds SHA-256 with 16-rounds SHA-256 and see what happens when you feed that with SHA-256 collisions or preimages, but I guess the client would rather crash than accept -10 block header (or even -1 block header). Also, for each block except Genesis, you have to provide previous block header first, so you can try to submit block header -1, but you will get an error saying that you need block header -2 first. Maybe you could meet that condition by having two blocks with the same hashes, but then other functions will crash, like getting block by hash. Anyway, by mining negative blocks, you will break your client.


Title: Re: Compile Bitcoin first version on Linux - Windres issues
Post by: j2002ba2 on November 02, 2021, 08:57:45 AM
Quote
Blockchain starts at the genesis block, I don't think you can mine blocks further below that.
To mine -1 block or earlier, you need SHA-256 collision.
Besides that, there's 36.8% chance that there cannot be block with hash zero. If only single SHA was used, then no problem. But double SHA means 256-bit to 256-bit random mapping at the second SHA, and about 1/e of the possible outputs are unreachable.



Title: Re: Compile Bitcoin first version on Linux - Windres issues
Post by: vjudeu on November 02, 2021, 01:00:45 PM
Quote
Besides that, there's 36.8% chance that there cannot be block with hash zero.
Yes, but there is still quite high chance that there could exist different Genesis Block with the same hash (a collision). Then, if you can reach the same SHA-256 for two 80-byte block headers, then you can replace previous block hash with something else. And then it may be possible to create previous block. But to be 100% sure, some experiments with faked hash functions are needed.