Bitcoin Forum
November 02, 2024, 06:05:27 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: need to check that binaries are generated from the exact source code  (Read 1419 times)
wolciph (OP)
Newbie
*
Offline Offline

Activity: 33
Merit: 0


View Profile
May 05, 2011, 09:51:26 AM
Last edit: May 05, 2011, 10:02:33 AM by wolciph
 #1

There is obviously a need to check that the bitcoin binary is indeed produced by building the source code which has (hopefully) been thoroughly checked. Otherwise someone could potentially introduce a backdoor to for instance steal bitcoins. This is especially important since I suppose most people using bitcoins do not bother with compiling it and as we gather more users, there will be more and more people using the precompiled binary.

To quote the README.md file:
Quote
The master branch is regularly built and tested (by who? need people willing to be quality assurance testers), and periodically pushed to the subversion repo to become the official, stable, released bitcoin.

In order to check the binary we need to be able to reproduce it exactly from the source. For that, we need to know the exact version of the compiler used, the exact version of the libraries used, a script that reproduces every step of the building process (modifications to the makefile, stripping debug symbols, ...), and anything else that I may have forgotten.
So please, whoever is in charge of creating the compiled packages (Gavin Anderson?), give us all the information needed to check them.
wumpus
Hero Member
*****
qt
Offline Offline

Activity: 812
Merit: 1022

No Maps for These Territories


View Profile
May 05, 2011, 10:13:04 AM
 #2

But if you went through all those steps to check the binary, you have built it yourself. So why not build it from source in the first place?


Bitcoin Core developer [PGP] Warning: For most, coin loss is a larger risk than coin theft. A disk can die any time. Regularly back up your wallet through FileBackup Wallet to an external storage or the (encrypted!) cloud. Use a separate offline wallet for storing larger amounts.
wolciph (OP)
Newbie
*
Offline Offline

Activity: 33
Merit: 0


View Profile
May 05, 2011, 10:20:28 AM
 #3

But if you went through all those steps to check the binary, you have built it yourself. So why not build it from source in the first place?


We would not be checking it for ourselves but for all the other people using bitcoin.
Maybe you are using the precompiled version. How do you know it doesn't have a backdoor? You don't! because nobody is checking.
dikidera
Full Member
***
Offline Offline

Activity: 126
Merit: 100


View Profile
May 05, 2011, 10:23:34 AM
 #4

I think what he's trying to say is that a random user can compile the program and say "Hey, i added X feature to bitcoin, try it!".

While in fact it had code that copies wallet.dat and send it to a remote server for someone else's use or directly sending the coins to a 'new' address.
wolciph (OP)
Newbie
*
Offline Offline

Activity: 33
Merit: 0


View Profile
May 05, 2011, 10:28:31 AM
 #5

I think what he's trying to say is that a random user can compile the program and say "Hey, i added X feature to bitcoin, try it!".

While in fact it had code that copies wallet.dat and send it to a remote server for someone else's use or directly sending the coins to a 'new' address.
No, I'm talking about the main version of bitcoin. You can't know that the person who compiled it didn't modify the code a bit just before doing so.
wumpus
Hero Member
*****
qt
Offline Offline

Activity: 812
Merit: 1022

No Maps for These Territories


View Profile
May 05, 2011, 10:34:37 AM
 #6

You're right, that makes sense.

But speaking from experience, it will be very difficult though to exactly reproduce a compilation environment. Getting the same targets is incredibly hard. A small unrelated difference in a .h file in some vague dependency can have impact on the optimisation process resulting in slightly different executable.

For some compilers, even the time and date (of the source files) and who knows, phase of the moon could matter Tongue

You could package the build environment as a VMWare/Virtualbox image and distribute that. But that'd only be legal for Linux. Also, how can you be sure that hasn't been tampered with. Hmm...

Edit: another solution would be to completely implement the bitcoin client in a readable language such as Python, that doesn't need a compile chain. Verifying is then a piece of cake. But where do you get the Python interpreter from...

Short story: just compile it yourself with your own trusted tools, ignore the posted binaries


Bitcoin Core developer [PGP] Warning: For most, coin loss is a larger risk than coin theft. A disk can die any time. Regularly back up your wallet through FileBackup Wallet to an external storage or the (encrypted!) cloud. Use a separate offline wallet for storing larger amounts.
Matt Corallo
Hero Member
*****
expert
Offline Offline

Activity: 755
Merit: 515


View Profile
May 05, 2011, 10:45:12 AM
 #7

He makes a good point and it is going to be fixed in 0.4.0.  For the next release, there will be a build script (put together by devrandom) which builds bitcoin deterministically and signs the results meaning 1. anyone can build bitcoin and get the exact same binary as a result and 2. the releases are made by having trusted developers sign the results so that no central authority has "the keys" to everyone's binaries.  All this said, you can currently audit the build as Gavin posts ec2 instances on each release which you can bootup and build bitcoin/check the system (if you have an EC2 account). 

Bitcoin Core, rust-lightning, http://bitcoinfibre.org etc.
PGP ID: 07DF 3E57 A548 CCFB 7530  7091 89BB B866 3E2E65CE
wumpus
Hero Member
*****
qt
Offline Offline

Activity: 812
Merit: 1022

No Maps for These Territories


View Profile
May 05, 2011, 10:47:41 AM
 #8

Cool!

Does that also work for the Windows version? (whose users are the biggest consumers of binaries, probably)

Bitcoin Core developer [PGP] Warning: For most, coin loss is a larger risk than coin theft. A disk can die any time. Regularly back up your wallet through FileBackup Wallet to an external storage or the (encrypted!) cloud. Use a separate offline wallet for storing larger amounts.
Matt Corallo
Hero Member
*****
expert
Offline Offline

Activity: 755
Merit: 515


View Profile
May 05, 2011, 10:56:11 AM
 #9

Cool!

Does that also work for the Windows version? (whose users are the biggest consumers of binaries, probably)
Yes, hopefully crosscompiling via MinGW will be used for the Windows version (it works now, but needs to be implemented in the new build process).  However, AFAIK its not doable for Mac.  If anyone knows of a way to do deterministic building, please contact me or devrandom.

Bitcoin Core, rust-lightning, http://bitcoinfibre.org etc.
PGP ID: 07DF 3E57 A548 CCFB 7530  7091 89BB B866 3E2E65CE
wolciph (OP)
Newbie
*
Offline Offline

Activity: 33
Merit: 0


View Profile
May 05, 2011, 11:01:16 AM
 #10

Good hearing that, BlueMatt.
Pages: [1]
  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!