<p>The challenge with creating reproducible builds is that you need to ensure that the build process matches exactly across different operating systems and different architectures. Bitcoin uses <a href="https://gitian.org/" rel="nofollow noreferrer">Gitian</a>, a deterministic build process to achieve that.</p>
<p>Bitcoin Core provides the configuration and build instructions for various operating systems in the <a href="https://github.com/bitcoin/bitcoin/tree/master/contrib/gitian-descriptors" rel="nofollow noreferrer"><code>/contrib/gitian-descriptors</code></a> directory in the Bitcoin source code.</p>
<p>For Linux you would use this <a href="https://github.com/bitcoin/bitcoin/blob/master/contrib/gitian-descriptors/gitian-linux.yml" rel="nofollow noreferrer">gitian-linux.yml</a>.</p>

CC BY-SA 4.0
2020-11-11T11:15:06.127Z
In 2017 I wrote a guide to a small guide (with script) to reproduce the Debian binaries with Gitian. 
The guide is obsolete and won't work for the current version, but it might still be helpful as a reference.
https://gist.github.com/frz-dev/3e3e906fa06294e61930e81b473e1e5b
FedFranz
CC BY-SA 4.0
2020-11-12T00:15:46.030Z
Did the gitian process with both debian 10 and ubuntu 20.04, produced the same binaries. However these binaries are not the same ones that were produced 3 months ago for v0.20.1. Doesn't seem to be an easy way to get the same environment that other people use even if using a VM as there is no standard image used prebaked with dependencies. Nearly all the documentation for gitian for all methods.. on bitcoin-core and devrandom is outdated and broken. This has been a very interesting* experience. Currently "Don't trust verify" seems to be more of a nice to have w/ downloaded binaries. When Ginx?
Michael Tidwell
CC BY-SA 4.0
2020-11-10T13:24:11.870Z
2020-11-10T13:24:11.870Z
Murch
<p>For anyone finding this like me... Gitian has been replaced by Guix.</p>
<p>But this post is still good for explaining why the builds using he default settings/instructions from the Bitcoin github are so much bigger than the binaries downloaded from bitcoincore.org.</p>

CC BY-SA 4.0
2023-12-12T04:39:32.023Z
2023-12-12T04:39:32.023Z
Bogi
<p>I'm hoping that someone can tell me how to get the same binary that we see on bitcoincore.org/bitcoin.org.</p>
<p>I tried using Ubuntu 20.04</p>
<pre><code>git clone https://github.com/bitcoin/bitcoin
git checkout v0.20.1
sudo apt-get update
sudo apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3 -y
sudo apt-get install libevent-dev libboost-system-dev libboost-filesystem-dev libboost-test-dev libboost-thread-dev -y
./autogen.sh
./configure --disable-wallet
make
make install
</code></pre>
<p>Extra details (git commit I'm going off of)</p>
<pre><code> git log
commit 7ff64311bee570874c4f0dfa18f518552188df08 (HEAD -&gt; 20.1, tag: v0.20.1)
Author: Wladimir J. van der Laan &lt;laanwj@protonmail.com&gt;
Date:   Fri Jul 31 14:01:56 2020 +0200

</code></pre>
<p>produces bitcoind: <code>d46f9ca67562129cb2f0d7ed7e0ae576ab06e616d98d28c2a262d82356f9d87b</code></p>
<hr />
<p>bitcoincore.org link I'm going off of:
<a href="https://bitcoincore.org/bin/bitcoin-core-0.20.1/bitcoin-0.20.1-x86_64-linux-gnu.tar.gz" rel="nofollow noreferrer">https://bitcoincore.org/bin/bitcoin-core-0.20.1/bitcoin-0.20.1-x86_64-linux-gnu.tar.gz</a></p>
<p>produces bitcoind: <code>4ec74161b2a90293926ae8e20a2efbe952bd23b53aeebf051e6a6285ace18271</code></p>
<p>I was hoping that someone could tell me how to properly configure/setup my environment to produce the same binary that we see packaged nicely in the tarball on these websites.
The binary files aren't even close in size…</p>
<p>from tarball bitcoind size:
10312344 (10 MB)</p>
<p>from building from scratch bitcoind size:
192814984 (192 MB)</p>
<p>How do I make the super sleek and sexy 10 MB version?</p>
<p>Thanks!</p>

CC BY-SA 4.0
2020-11-10T17:56:13.283Z
The size is due to the inclusion of debug symbols; you can compile without them (`CXXFLAGS="-O2 -g0"` for example at configure time), or you can strip them after compilation (`strip bitcoind`). That will result in a similarly small file, but it won't give you a binary that's identical to the release binary. To do so, follow the gitian-based process like Murch suggests below.
Pieter Wuille
<bitcoind><gitian>
How can I reproduce the same binary as bitcoin.org or bitcoincore.org?
Michael Tidwell
# How can I reproduce the same binary as bitcoin.org or bitcoincore.org?

(Asked by: username_0 on 2020-11-10)

I'm hoping that someone can tell me how to get the same binary that we see on bitcoincore.org/bitcoin.org.

I tried using Ubuntu 20.04

```
git clone https://github.com/bitcoin/bitcoin
git checkout v0.20.1
sudo apt-get update
sudo apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3 -y
sudo apt-get install libevent-dev libboost-system-dev libboost-filesystem-dev libboost-test-dev libboost-thread-dev -y
./autogen.sh
./configure --disable-wallet
make
make install

```

Extra details (git commit I'm going off of)

```
 git log
commit 7ff64311bee570874c4f0dfa18f518552188df08 (HEAD -> 20.1, tag: v0.20.1)
Author: Wladimir J. van der Laan <laanwj@protonmail.com>
Date:   Fri Jul 31 14:01:56 2020 +0200

```

produces bitcoind: `d46f9ca67562129cb2f0d7ed7e0ae576ab06e616d98d28c2a262d82356f9d87b`

---

bitcoincore.org link I'm going off of:
<https://bitcoincore.org/bin/bitcoin-core-0.20.1/bitcoin-0.20.1-x86_64-linux-gnu.tar.gz>

produces bitcoind: `4ec74161b2a90293926ae8e20a2efbe952bd23b53aeebf051e6a6285ace18271`

I was hoping that someone could tell me how to properly configure/setup my environment to produce the same binary that we see packaged nicely in the tarball on these websites.
The binary files aren't even close in size…

from tarball bitcoind size:
10312344 (10 MB)

from building from scratch bitcoind size:
192814984 (192 MB)

How do I make the super sleek and sexy 10 MB version?

Thanks!

**Tags:** bitcoind, gitian

> **Comments:**
> **username_1**: The size is due to the inclusion of debug symbols; you can compile without them (`CXXFLAGS="-O2 -g0"` for example at configure time), or you can strip them after compilation (`strip bitcoind`). That will result in a similarly small file, but it won't give you a binary that's identical to the release binary. To do so, follow the gitian-based process like username_2 suggests below.  

---

## 2 answers

### Answer by username_2 on 2020-11-10. Score: 2

The challenge with creating reproducible builds is that you need to ensure that the build process matches exactly across different operating systems and different architectures. Bitcoin uses [Gitian](https://gitian.org/), a deterministic build process to achieve that.

Bitcoin Core provides the configuration and build instructions for various operating systems in the [`/contrib/gitian-descriptors`](https://github.com/bitcoin/bitcoin/tree/master/contrib/gitian-descriptors) directory in the Bitcoin source code.

For Linux you would use this [gitian-linux.yml](https://github.com/bitcoin/bitcoin/blob/master/contrib/gitian-descriptors/gitian-linux.yml).

> **Comments:**
> **username_3**: In 2017 I wrote a guide to a small guide (with script) to reproduce the Debian binaries with Gitian.  The guide is obsolete and won't work for the current version, but it might still be helpful as a reference. https://gist.github.com/frz-dev/3e3e906fa06294e61930e81b473e1e5b  
> **username_0**: Did the gitian process with both debian 10 and ubuntu 20.04, produced the same binaries. However these binaries are not the same ones that were produced 3 months ago for v0.20.1. Doesn't seem to be an easy way to get the same environment that other people use even if using a VM as there is no standard image used prebaked with dependencies. Nearly all the documentation for gitian for all methods.. on bitcoin-core and devrandom is outdated and broken. This has been a very interesting* experience. Currently "Don't trust verify" seems to be more of a nice to have w/ downloaded binaries. When Ginx?  

---

### Answer by username_4 on 2023-12-12. Score: 1

For anyone finding this like me... Gitian has been replaced by Guix.

But this post is still good for explaining why the builds using he default settings/instructions from the Bitcoin github are so much bigger than the binaries downloaded from bitcoincore.org.


---

