1 源码下载




Announcing the first release of Bitcoin, a new electronic cash

system that uses a peer-to-peer network to prevent double-spending.

It's completely decentralized with no server or central authority.

See bitcoin.org for screenshots.

Download link:


Windows only for now. Open source C++ code is included.

- Unpack the files into a directory


- It automatically connects to other nodes

If you can keep a node running that accepts incoming connections,

you'll really be helping the network a lot. Port 8333 on your

firewall needs to be open to receive incoming connections.

The software is still alpha and experimental. There's no guarantee

the system's state won't have to be restarted at some point if it

becomes necessary, although I've done everything I can to build in

extensibility and versioning.

You can get coins by getting someone to send you some, or turn on

Options->Generate Coins to run a node and generate blocks. I made

the proof-of-work difficulty ridiculously easy to start with, so

for a little while in the beginning a typical PC will be able to

generate coins in just a few hours. It'll get a lot harder when

competition makes the automatic adjustment drive up the difficulty.

Generated coins must wait 120 blocks to mature before they can be


There are two ways to send money. If the recipient is online, you

can enter their IP address and it will connect, get a new public

key and send the transaction with comments. If the recipient is

not online, it is possible to send to their Bitcoin address, which

is a hash of their public key that they give you. They'll receive

the transaction the next time they connect and get the block it's

in. This method has the disadvantage that no comment information

is sent, and a bit of privacy may be lost if the address is used

multiple times, but it is a useful alternative if both users can't

be online at the same time or the recipient can't receive incoming


Total circulation will be 21,000,000 coins. It'll be distributed

to network nodes when they make blocks, with the amount cut in half

every 4 years.

first 4 years: 10,500,000 coins

next 4 years: 5,250,000 coins

next 4 years: 2,625,000 coins

next 4 years: 1,312,500 coins


When that runs out, the system can support transaction fees if

needed. It's based on open market competition, and there will

probably always be nodes willing to process transactions for free.

Satoshi Nakamoto


wxWidgets http://www.wxwidgets.org/downloads/

OpenSSL http://www.openssl.org/source/

Berkeley DB http://www.oracle.com/technology/software/products/berkeley-db/index.html

Boost http://www.boost.org/users/download/

2 编译依赖库

2.1 编译wxWidgets


2.2 编译OpenSSL

OpenSSL 是一个安全套接字层密码库,囊括主要的加密算法,比特币源码直接使用了该库中的相关加密算法。这里选用的是源码说明文件readme.txt中的版本openssl-0.9.8h.tar.gz,编译OpenSSL需要安装nasm和ActivePerl可参考如下网址



perl Configure VC-WIN32
nmake -f ms\ntdll.mak

2.3 编译Berkeley DB

Berkeley DB是一个开源的文件数据库,比特币借助该库实现文件存取,这里选用的版本是db-4.7.25.tar.gz,直接用VC6.0打开图中工程,并编译其中Win32 Debug x86和Win32 Release x86版本

2.4 编译Boost




(2)有了bjam之后,运行 bjam --toolset=msvc-6.0进行编译,bjam --toolset=msvc-6.0 install 生成相应的头文件(include)和 库文件(lib),默认生成在C:\boost下面。

3 新建VC工程并编译

3.1 新建工程


3.2 添加源码文件


3.3 修改编译选项

将第2节编译好的库文件及相关头文件拷贝到工程目录下(如果不拷贝到工程目录,则添加头文件目录时请填写相应的文件路径),添加相应库头文件路径到附加头文件目录,添加宏定义D__WXMSW__,__WXDEBUG__到预定义中;添加相应的库文件目录到附加文件目录,添加相应的依赖库文件,libeay32.lib libdb47sd.lib wxmsw28d_richtext.lib wxmsw28d_html.lib wxmsw28d_core.lib wxbase28d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib ws2_32.lib,改Code Generation中Use run-time library为Debug Multithreaded DLL,在编译选项中添加/Zm300,否则编译时会有“compiler limit : internal heap limit reached; use /Zm to specify a higher limit”错误提示,在Resources设置下添加附件包含路径include,主要编译设置如下图


posted @ 2018-09-03 12:31 weiwei22844 阅读(...) 评论(...) 编辑 收藏