<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://zh-cn.bitcoin.it/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=023yangbo</id>
	<title>Bitcoin Wiki - 用户贡献 [zh-cn]</title>
	<link rel="self" type="application/atom+xml" href="https://zh-cn.bitcoin.it/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=023yangbo"/>
	<link rel="alternate" type="text/html" href="https://zh-cn.bitcoin.it/wiki/%E7%89%B9%E6%AE%8A:%E7%94%A8%E6%88%B7%E8%B4%A1%E7%8C%AE/023yangbo"/>
	<updated>2026-05-05T20:00:46Z</updated>
	<subtitle>用户贡献</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://zh-cn.bitcoin.it/w/index.php?title=Testnet&amp;diff=378</id>
		<title>Testnet</title>
		<link rel="alternate" type="text/html" href="https://zh-cn.bitcoin.it/w/index.php?title=Testnet&amp;diff=378"/>
		<updated>2011-08-15T13:58:56Z</updated>

		<summary type="html">&lt;p&gt;023yangbo：​以内容“&amp;#039;&amp;#039;&amp;#039;测试网络&amp;#039;&amp;#039;&amp;#039;被设计来替代 Bitcoin block chain，用于测试。它允许程序开发者或 bitcoin 试用者进行试验性的操作，而不用担心...”创建新页面&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;测试网络&#039;&#039;&#039;被设计来替代 Bitcoin [[block chain]]，用于测试。它允许程序开发者或 bitcoin 试用者进行试验性的操作，而不用担心破费 bitcoin 或破解 bitcoin chain.&lt;br /&gt;
&lt;br /&gt;
运行 bitcoin 或 bitcoind 时添加参数 -testnet 即可，或者在 bitcoin.conf 中添加一行 testnet=1 亦可。&lt;br /&gt;
&lt;br /&gt;
==两者区别==&lt;br /&gt;
* 使用18333端口替代8333。&lt;br /&gt;
* Bootstrapping IRC channel is #bitcoinTEST instead of #bitcoin (both on irc.lfnet.org). The built-in node list is disabled.&lt;br /&gt;
* A different value of ADDRESSVERSION field ensures no testnet BitCoin addresses will work on the production network. (0x6F rather than 0x00)&lt;br /&gt;
* The protocol message header bytes are shifted up (0xFABFB5DA instead of 0xF9BEB4D9)&lt;br /&gt;
* Minimum [[difficulty]] of 1.0 on testnet is equal to difficulty of 0.5 on mainnet. This means that the mainnet-equivalent of any testnet difficulty is half the testnet difficulty.&lt;br /&gt;
* A new genesis block&lt;br /&gt;
&lt;br /&gt;
==Genesis Block==&lt;br /&gt;
&lt;br /&gt;
Testnet uses a different genesis block to the main network. You can find it at http://blockexplorer.com/testnet/b/0&lt;br /&gt;
The testnet was reset with a new genesis block for the 0.3.20 bitcoin release.&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
* [https://sourceforge.net/projects/bitcoin/files/Bitcoin/testnet-in-a-box/ Testnet-In-A-Box self-contained testnet]&lt;br /&gt;
* [http://www.bitcoin.org/smf/index.php?topic=363.0 Test Network forum topic]&lt;br /&gt;
* [https://freebitcoins.appspot.com/test/ Testnet Faucet]&lt;br /&gt;
* [http://blockexplorer.com/testnet Testnet Block Explorer]&lt;br /&gt;
* [http://blockexplorer.com/testnet/q/getdifficulty Testnet current difficulty] As output by BitCoin&#039;s getDifficulty]&lt;br /&gt;
&lt;br /&gt;
[[Category:Technical]]&lt;br /&gt;
[[Category:Developer]]&lt;/div&gt;</summary>
		<author><name>023yangbo</name></author>
	</entry>
	<entry>
		<id>https://zh-cn.bitcoin.it/w/index.php?title=Data_directory&amp;diff=375</id>
		<title>Data directory</title>
		<link rel="alternate" type="text/html" href="https://zh-cn.bitcoin.it/w/index.php?title=Data_directory&amp;diff=375"/>
		<updated>2011-08-14T05:00:01Z</updated>

		<summary type="html">&lt;p&gt;023yangbo：​以内容“保存 Bitcoin 数据文件的地方，包括你的钱包。  ==默认位置== === Windows ===  点击 开始-&amp;gt;运行（按WinKey+R亦可）并运行下...”创建新页面&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;保存 Bitcoin 数据文件的地方，包括你的[[钱包|钱包]]。&lt;br /&gt;
&lt;br /&gt;
==默认位置==&lt;br /&gt;
=== Windows ===&lt;br /&gt;
&lt;br /&gt;
点击 开始-&amp;gt;运行（按WinKey+R亦可）并运行下面的命令:&lt;br /&gt;
&lt;br /&gt;
 explorer %APPDATA%\Bitcoin&lt;br /&gt;
&lt;br /&gt;
Bitcoin 数据文件夹就打开了，对于绝大多数用户来说，应该会是以下的地址：&lt;br /&gt;
&lt;br /&gt;
 C:\Documents and Settings\用户名\Application data\Bitcoin (XP)&lt;br /&gt;
 &lt;br /&gt;
 C:\Users\用户名\Appdata\Roaming\Bitcoin (Vista and 7)&lt;br /&gt;
&lt;br /&gt;
&amp;quot;AppData&amp;quot; 和 &amp;quot;Application data&amp;quot; 默认为隐藏文件夹。&lt;br /&gt;
&lt;br /&gt;
=== Linux ===&lt;br /&gt;
&lt;br /&gt;
Bitcoin 默认将数据放在以下位置：&lt;br /&gt;
&lt;br /&gt;
 ~/.bitcoin/&lt;br /&gt;
&lt;br /&gt;
你需要运行 &amp;quot;ls -a&amp;quot; 命令才能看到以点开头的文件夹。&lt;br /&gt;
&lt;br /&gt;
如果不存在，请直接查找，下面是一个例子：&lt;br /&gt;
&lt;br /&gt;
 find / -name wallet.dat -print 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
=== Mac ===&lt;br /&gt;
&lt;br /&gt;
Bitcoin 默认在下面这个地方存放数据：&lt;br /&gt;
&lt;br /&gt;
 ~/Library/Application Support/Bitcoin/&lt;br /&gt;
&lt;br /&gt;
==文件夹内容==&lt;br /&gt;
&lt;br /&gt;
===子文件夹===&lt;br /&gt;
* database&lt;br /&gt;
**Contains journaling files for the block database  &lt;br /&gt;
* testnet&lt;br /&gt;
**以上数据的测试版Contains testnet versions of these files (if running with -testnet)&lt;br /&gt;
&lt;br /&gt;
===Files===&lt;br /&gt;
* .lock&lt;br /&gt;
**BDB 数据库锁定标志文件&lt;br /&gt;
* bitcoin.conf [可选]&lt;br /&gt;
**包括[[运行Bitcoin#Bitcoin.conf配置文件|配置选项]]。&lt;br /&gt;
* blk&#039;&#039;xxxx&#039;&#039;.dat&lt;br /&gt;
**货币包信息，Contains concatenated raw blocks&lt;br /&gt;
* blkindex.dat&lt;br /&gt;
**blk&#039;&#039;xxxx&#039;&#039;.dat 使用的索引信息&lt;br /&gt;
* __db.&#039;&#039;xxx&#039;&#039;&lt;br /&gt;
**BDB 数据库使用&lt;br /&gt;
* db.log&lt;br /&gt;
* debug.log&lt;br /&gt;
**Bitcoin 日志文件，会不定期自动删除过期记录。&lt;br /&gt;
* wallet.dat&lt;br /&gt;
**最重要的[[钱包]]，保存 keys,交易记录, metadata, 和有关选项。未使用 BDB 数据库（？）。&lt;br /&gt;
&lt;br /&gt;
数据、索引和日志文件都使用了Oracle [http://zh.wikipedia.org/wiki/Berkeley_DB Berkeley 数据库]，其嵌入式键/值数据存储正是 Bitcoin 所使用的。&lt;br /&gt;
&lt;br /&gt;
==查看其它==&lt;br /&gt;
&lt;br /&gt;
* [[保护你的钱包]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Technical]]&lt;/div&gt;</summary>
		<author><name>023yangbo</name></author>
	</entry>
	<entry>
		<id>https://zh-cn.bitcoin.it/w/index.php?title=PHP%E5%BC%80%E5%8F%91%E8%80%85%E6%8C%87%E5%8D%97&amp;diff=374</id>
		<title>PHP开发者指南</title>
		<link rel="alternate" type="text/html" href="https://zh-cn.bitcoin.it/w/index.php?title=PHP%E5%BC%80%E5%8F%91%E8%80%85%E6%8C%87%E5%8D%97&amp;diff=374"/>
		<updated>2011-08-14T04:25:35Z</updated>

		<summary type="html">&lt;p&gt;023yangbo：​/* 配置 Bitcoin */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;L&#039;&#039;&#039;inux &#039;&#039;&#039;A&#039;&#039;&#039;pache &#039;&#039;&#039;M&#039;&#039;&#039;ySQL &#039;&#039;&#039;P&#039;&#039;&#039;HP + Bitcoin 教程。&lt;br /&gt;
&lt;br /&gt;
本教程假设运行 PHP 脚本的服务器为 Ubuntu，本例将让一个购物网站接受 Bitcoin. 我们假设你已经了解了一些 Bitcoin 的一些知识并有一定的 PHP 开发经验.&lt;br /&gt;
&lt;br /&gt;
当然，你也可以将这里的 PHP 语言替换为你熟悉的其它语言，请访问[[API reference (JSON-RPC)|API参考手册 (JSON-RPC)]]了解更多。&lt;br /&gt;
&lt;br /&gt;
请保持你的 Bitcoin 运行于服务器模式，PHP 通过本地 HTTP 请求与之进行通信，使用[http://jsonrpcphp.org/ JSON-RPC]库来运行完成功能，服务器将返回[http://en.wikipedia.org/wiki/Json JSON]格式数据。&lt;br /&gt;
&lt;br /&gt;
== 配置 Bitcoin ==&lt;br /&gt;
&lt;br /&gt;
你需要 bitcoind 命令行程序，你可以自行编译码代码，也可以从 [http://www.bitcoin.org/ bitcoin.org] 下载二进制文件.&lt;br /&gt;
&lt;br /&gt;
关于如何配置 bitcoin 请查看[[Running Bitcoin]]了解更多。&lt;br /&gt;
&lt;br /&gt;
运行 bitcoind 之前需要在 bitcoin 数据文件夹中新建一个配置文件(Linux 系统位于~/.bitcoin/bitcoin.conf，Windows 位于%APPDATA%\Bitcoin\)包括以下内容:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpcuser=user&lt;br /&gt;
rpcpassword={you MUST pick a unique password to be secure}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
然后运行 bitcoind，我们建议你先泡杯茶:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ ./bitcoind&lt;br /&gt;
# 启动有点慢，要有耐心&lt;br /&gt;
$ ./bitcoind getinfo&lt;br /&gt;
# 显示有关信息，various info shown&lt;br /&gt;
$ ./bitcoind help&lt;br /&gt;
# 帮助，help on commands&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bitcoin 就初始化成功了，你现在要做的就是慢慢品茶，等着下载“货币包（blocks）”，[http://blockexplorer.com/q/getblockcount 查看现有货币包].&lt;br /&gt;
&lt;br /&gt;
== First steps ==&lt;br /&gt;
&lt;br /&gt;
Assuming Bitcoin has finished the initialisation process; download the file jsonRPCClient.php from [http://jsonrpcphp.org/ JSON-RPC PHP]. The other files can be safely discarded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
  require_once &#039;jsonRPCClient.php&#039;;&lt;br /&gt;
  &lt;br /&gt;
  $bitcoin = new jsonRPCClient(&#039;http://user:password@127.0.0.1:8332/&#039;);&lt;br /&gt;
   &lt;br /&gt;
  echo &amp;quot;&amp;lt;pre&amp;gt;\n&amp;quot;;&lt;br /&gt;
  print_r($bitcoin-&amp;gt;getinfo());&lt;br /&gt;
  echo &amp;quot;&amp;lt;/pre&amp;gt;&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Precision ==&lt;br /&gt;
&lt;br /&gt;
Bitcoin amounts can range from 1 (0.00000001 BTC) to nearly 2,100,000,000,000,000 (21,000,000 BTC).  To avoid rounding errors, you must make sure your PHP implementation supports the full range of bitcoin values without losing precision.  Most PHP implementations use IEEE 64-bit double-precision floating point numbers, which have 53 bits of precision, which is enough to correctly represent the full range of bitcoin values.&lt;br /&gt;
&lt;br /&gt;
See [[Proper Money Handling (JSON-RPC)]] for more information.&lt;br /&gt;
&lt;br /&gt;
If your PHP implementation does not support 64-bit numbers (again, this is very rare), you must use a version of bitcoind that sends values as strings (genjix maintains a fork at http://github.com/genjix/bitcoin) and use the  [http://php.net/manual/en/ref.gmp.php GMP] and [http://php.net/manual/en/ref.bc.php BC Math] libraries for all calculations involving bitcoin amounts.&lt;br /&gt;
&lt;br /&gt;
== Accounts ==&lt;br /&gt;
&lt;br /&gt;
In Bitcoin, money is sent to addresses. Your balance is the total of all the money in all the address in your wallet.&lt;br /&gt;
&lt;br /&gt;
Bitcoin goes another step. You can have [[Accounts explained|accounts]]. Each account holds multiple addresses and acts like a mini-Bitcoin.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ ./bitcoind listaccounts&lt;br /&gt;
# show list of accounts and various info for each one&lt;br /&gt;
$ ./bitcoind getaccountaddress user889&lt;br /&gt;
# get an address to receive money to that is unique for the account user889&lt;br /&gt;
$ ./bitcoind getbalance user889&lt;br /&gt;
# get the sum of all the money in the addresses owned by the account user889&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In your shopping system, each user should have a unique username. You then query bitcoin for a unique address using $bitcoin-&amp;gt;getaccountaddress(&amp;quot;user889&amp;quot;); [gets the first address for user889] or $bitcoin-&amp;gt;getnewaddress(&amp;quot;user889&amp;quot;); [creates a new address for user889].&lt;br /&gt;
&lt;br /&gt;
The customer then deposits to this address.&lt;br /&gt;
&lt;br /&gt;
You can check the funds for that customer by doing $bitcoin-&amp;gt;getbalance(&amp;quot;user889&amp;quot;, 4);. The 4 indicates the minimum number of confirmations we will accept before assuming this payment is valid.&lt;br /&gt;
&lt;br /&gt;
=== getnewaddress vs getaccountaddress ===&lt;br /&gt;
&lt;br /&gt;
Using getnewaddress helps increase the anonymity of your customers by making it hard to track their payments from the POV of a malicious agent. However running it too often will cause your wallet to become filled with many empty addresses.&lt;br /&gt;
&lt;br /&gt;
I recommend that you do something like:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
    require_once(&#039;jsonRPCClient.php&#039;);&lt;br /&gt;
    $bitcoin = new jsonRPCClient(&#039;http://root:root@127.0.0.1:8332/&#039;); &lt;br /&gt;
    # now check for appropriate funds in user account&lt;br /&gt;
    try {&lt;br /&gt;
        $username = ...&lt;br /&gt;
        if(isset($_SESSION[&#039;sendaddress&#039;]))&lt;br /&gt;
            $sendaddress = $_SESSION[&#039;sendaddress&#039;];&lt;br /&gt;
        else {&lt;br /&gt;
            $sendaddress = $bitcoin-&amp;gt;getnewaddress($username);&lt;br /&gt;
            $_SESSION[&#039;sendaddress&#039;] = $sendaddress;&lt;br /&gt;
        }&lt;br /&gt;
        $balance = $bitcoin-&amp;gt;getbalance($username);&lt;br /&gt;
    }&lt;br /&gt;
    catch (Exception $e) {&lt;br /&gt;
        die(&amp;quot;&amp;lt;p&amp;gt;Server error! Please contact the admin.&amp;lt;/p&amp;gt;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This creates a new address at the beginning of every new session, and stores it in the session variable.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
* [[API reference (JSON-RPC)]]&lt;br /&gt;
* [[Lazy_API]]&lt;br /&gt;
* [[Merchant Howto]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;/div&gt;</summary>
		<author><name>023yangbo</name></author>
	</entry>
	<entry>
		<id>https://zh-cn.bitcoin.it/w/index.php?title=PHP%E5%BC%80%E5%8F%91%E8%80%85%E6%8C%87%E5%8D%97&amp;diff=371</id>
		<title>PHP开发者指南</title>
		<link rel="alternate" type="text/html" href="https://zh-cn.bitcoin.it/w/index.php?title=PHP%E5%BC%80%E5%8F%91%E8%80%85%E6%8C%87%E5%8D%97&amp;diff=371"/>
		<updated>2011-07-30T17:53:16Z</updated>

		<summary type="html">&lt;p&gt;023yangbo：​以内容“&amp;#039;&amp;#039;&amp;#039;L&amp;#039;&amp;#039;&amp;#039;inux &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;pache &amp;#039;&amp;#039;&amp;#039;M&amp;#039;&amp;#039;&amp;#039;ySQL &amp;#039;&amp;#039;&amp;#039;P&amp;#039;&amp;#039;&amp;#039;HP + Bitcoin 教程。  本教程假设运行 PHP 脚本的服务器为 Ubuntu，本例将让一个购物网站接受 Bit...”创建新页面&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;L&#039;&#039;&#039;inux &#039;&#039;&#039;A&#039;&#039;&#039;pache &#039;&#039;&#039;M&#039;&#039;&#039;ySQL &#039;&#039;&#039;P&#039;&#039;&#039;HP + Bitcoin 教程。&lt;br /&gt;
&lt;br /&gt;
本教程假设运行 PHP 脚本的服务器为 Ubuntu，本例将让一个购物网站接受 Bitcoin. 我们假设你已经了解了一些 Bitcoin 的一些知识并有一定的 PHP 开发经验.&lt;br /&gt;
&lt;br /&gt;
当然，你也可以将这里的 PHP 语言替换为你熟悉的其它语言，请访问[[API reference (JSON-RPC)|API参考手册 (JSON-RPC)]]了解更多。&lt;br /&gt;
&lt;br /&gt;
请保持你的 Bitcoin 运行于服务器模式，PHP 通过本地 HTTP 请求与之进行通信，使用[http://jsonrpcphp.org/ JSON-RPC]库来运行完成功能，服务器将返回[http://en.wikipedia.org/wiki/Json JSON]格式数据。&lt;br /&gt;
&lt;br /&gt;
== 配置 Bitcoin ==&lt;br /&gt;
&lt;br /&gt;
你需要 bitcoind 命令行程序，你可以自行编译码代码，也可以从 [http://www.bitcoin.org/ bitcoin.org] 下载二进制文件.&lt;br /&gt;
&lt;br /&gt;
关于如何配置 bitcoin 请查看[[Running Bitcoin]]了解更多。&lt;br /&gt;
&lt;br /&gt;
Before running bitcoind you will need to create a file in the bitcoin data directory (~/.bitcoin/bitcoin.conf on Linux):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpcuser=user&lt;br /&gt;
rpcpassword={you MUST pick a unique password to be secure}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now run bitcoind:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ ./bitcoind&lt;br /&gt;
# wait a few seconds for it to start up&lt;br /&gt;
$ ./bitcoind getinfo&lt;br /&gt;
# various info shown&lt;br /&gt;
$ ./bitcoind help&lt;br /&gt;
# help on commands&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bitcoin is now initialising and you must wait until &amp;quot;blocks&amp;quot; is at the [http://blockexplorer.com/q/getblockcount current count].&lt;br /&gt;
&lt;br /&gt;
== First steps ==&lt;br /&gt;
&lt;br /&gt;
Assuming Bitcoin has finished the initialisation process; download the file jsonRPCClient.php from [http://jsonrpcphp.org/ JSON-RPC PHP]. The other files can be safely discarded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
  require_once &#039;jsonRPCClient.php&#039;;&lt;br /&gt;
  &lt;br /&gt;
  $bitcoin = new jsonRPCClient(&#039;http://user:password@127.0.0.1:8332/&#039;);&lt;br /&gt;
   &lt;br /&gt;
  echo &amp;quot;&amp;lt;pre&amp;gt;\n&amp;quot;;&lt;br /&gt;
  print_r($bitcoin-&amp;gt;getinfo());&lt;br /&gt;
  echo &amp;quot;&amp;lt;/pre&amp;gt;&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Precision ==&lt;br /&gt;
&lt;br /&gt;
Bitcoin amounts can range from 1 (0.00000001 BTC) to nearly 2,100,000,000,000,000 (21,000,000 BTC).  To avoid rounding errors, you must make sure your PHP implementation supports the full range of bitcoin values without losing precision.  Most PHP implementations use IEEE 64-bit double-precision floating point numbers, which have 53 bits of precision, which is enough to correctly represent the full range of bitcoin values.&lt;br /&gt;
&lt;br /&gt;
See [[Proper Money Handling (JSON-RPC)]] for more information.&lt;br /&gt;
&lt;br /&gt;
If your PHP implementation does not support 64-bit numbers (again, this is very rare), you must use a version of bitcoind that sends values as strings (genjix maintains a fork at http://github.com/genjix/bitcoin) and use the  [http://php.net/manual/en/ref.gmp.php GMP] and [http://php.net/manual/en/ref.bc.php BC Math] libraries for all calculations involving bitcoin amounts.&lt;br /&gt;
&lt;br /&gt;
== Accounts ==&lt;br /&gt;
&lt;br /&gt;
In Bitcoin, money is sent to addresses. Your balance is the total of all the money in all the address in your wallet.&lt;br /&gt;
&lt;br /&gt;
Bitcoin goes another step. You can have [[Accounts explained|accounts]]. Each account holds multiple addresses and acts like a mini-Bitcoin.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ ./bitcoind listaccounts&lt;br /&gt;
# show list of accounts and various info for each one&lt;br /&gt;
$ ./bitcoind getaccountaddress user889&lt;br /&gt;
# get an address to receive money to that is unique for the account user889&lt;br /&gt;
$ ./bitcoind getbalance user889&lt;br /&gt;
# get the sum of all the money in the addresses owned by the account user889&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In your shopping system, each user should have a unique username. You then query bitcoin for a unique address using $bitcoin-&amp;gt;getaccountaddress(&amp;quot;user889&amp;quot;); [gets the first address for user889] or $bitcoin-&amp;gt;getnewaddress(&amp;quot;user889&amp;quot;); [creates a new address for user889].&lt;br /&gt;
&lt;br /&gt;
The customer then deposits to this address.&lt;br /&gt;
&lt;br /&gt;
You can check the funds for that customer by doing $bitcoin-&amp;gt;getbalance(&amp;quot;user889&amp;quot;, 4);. The 4 indicates the minimum number of confirmations we will accept before assuming this payment is valid.&lt;br /&gt;
&lt;br /&gt;
=== getnewaddress vs getaccountaddress ===&lt;br /&gt;
&lt;br /&gt;
Using getnewaddress helps increase the anonymity of your customers by making it hard to track their payments from the POV of a malicious agent. However running it too often will cause your wallet to become filled with many empty addresses.&lt;br /&gt;
&lt;br /&gt;
I recommend that you do something like:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
    require_once(&#039;jsonRPCClient.php&#039;);&lt;br /&gt;
    $bitcoin = new jsonRPCClient(&#039;http://root:root@127.0.0.1:8332/&#039;); &lt;br /&gt;
    # now check for appropriate funds in user account&lt;br /&gt;
    try {&lt;br /&gt;
        $username = ...&lt;br /&gt;
        if(isset($_SESSION[&#039;sendaddress&#039;]))&lt;br /&gt;
            $sendaddress = $_SESSION[&#039;sendaddress&#039;];&lt;br /&gt;
        else {&lt;br /&gt;
            $sendaddress = $bitcoin-&amp;gt;getnewaddress($username);&lt;br /&gt;
            $_SESSION[&#039;sendaddress&#039;] = $sendaddress;&lt;br /&gt;
        }&lt;br /&gt;
        $balance = $bitcoin-&amp;gt;getbalance($username);&lt;br /&gt;
    }&lt;br /&gt;
    catch (Exception $e) {&lt;br /&gt;
        die(&amp;quot;&amp;lt;p&amp;gt;Server error! Please contact the admin.&amp;lt;/p&amp;gt;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This creates a new address at the beginning of every new session, and stores it in the session variable.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
* [[API reference (JSON-RPC)]]&lt;br /&gt;
* [[Lazy_API]]&lt;br /&gt;
* [[Merchant Howto]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;/div&gt;</summary>
		<author><name>023yangbo</name></author>
	</entry>
	<entry>
		<id>https://zh-cn.bitcoin.it/w/index.php?title=%E8%B4%AD%E4%B9%B0bitcoin&amp;diff=370</id>
		<title>购买bitcoin</title>
		<link rel="alternate" type="text/html" href="https://zh-cn.bitcoin.it/w/index.php?title=%E8%B4%AD%E4%B9%B0bitcoin&amp;diff=370"/>
		<updated>2011-07-30T17:30:12Z</updated>

		<summary type="html">&lt;p&gt;023yangbo：​/* 大额兑换 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;刚开始接触比特币的新手通常对如何才能获得比特币感到疑惑。这篇文章可以除去你的疑惑，给出一些兑换比特币的途径。&lt;br /&gt;
&lt;br /&gt;
==大额兑换==&lt;br /&gt;
&lt;br /&gt;
如果购买比特币的数目较大(1000美元或更多), 可以通过银行电子汇款，自动结算中心转账（ACH），欧洲银行转账，这样可以最大程度的减少换汇的手续费用。或者也可以通过“自由储备”（Liberty Reserve)而进入市场参与交易。同时，你也可以通过这些市场将手中的比特币兑换出去。以下是可以进行比特币在线交易的网站:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 交易商 || 类型 || 充值方式 || 提现方式 || 备注&lt;br /&gt;
|-&lt;br /&gt;
|  [https://www.mtgox.com MtGox] || 交易市场 || BTC&amp;lt;br/&amp;gt;Liberty Reserve USD&amp;lt;br /&amp;gt;USD (电汇)&amp;lt;br /&amp;gt;USD ([[Dwolla]])&amp;lt;br /&amp;gt;USD ([[Paxum]])&amp;lt;br /&amp;gt;USD (ACH)&amp;lt;br /&amp;gt;EUR ([http://en.wikipedia.org/wiki/Single_Euro_Payments_Area SEPA] 电汇)&amp;lt;br /&amp;gt;AUD (电汇)|| BTC&amp;lt;br /&amp;gt;Liberty Reserve USD&amp;lt;br /&amp;gt;USD ([[Dwolla]])&amp;lt;br /&amp;gt;USD ([[Paxum]])&amp;lt;br /&amp;gt;USD (ACH 直接到账)&amp;lt;br /&amp;gt;EUR ([http://en.wikipedia.org/wiki/Single_Euro_Payments_Area SEPA] 电汇) || 提现金额有限制。&lt;br /&gt;
|-&lt;br /&gt;
|  [[Britcoin]] || 交易市场 || BTC&amp;lt;br /&amp;gt;GBP (银行转帐)&amp;lt;br /&amp;gt;[[PokerStars]] USD&amp;lt;br /&amp;gt; || BTC&amp;lt;br /&amp;gt;GBP (银行转帐)&amp;lt;br /&amp;gt;PokerStars USD&amp;lt;br /&amp;gt; ||&lt;br /&gt;
|-&lt;br /&gt;
|  [[Btcex]] || 交易市场 || BTC&amp;lt;br /&amp;gt;USD (国际电汇)&amp;lt;br /&amp;gt;EUR (银行转帐)&amp;lt;br /&amp;gt;JPY (银行转帐)&amp;lt;br /&amp;gt;RUS (RUB, Yandex, WebMoney) || BTC&amp;lt;br /&amp;gt;USD (国际电汇)&amp;lt;br /&amp;gt;EUR (bank transfer)&amp;lt;br /&amp;gt; || 美元在瑞士中转。&amp;lt;br /&amp;gt;欧元在芬兰中转。&amp;lt;br /&amp;gt;RUS (RUB, Yandex, WebMoney).&lt;br /&gt;
|-&lt;br /&gt;
|  [https://www.virwox.com VirWoX] || 交易市场 || BTC&amp;lt;br/&amp;gt;SLL (Second Life)&amp;lt;br/&amp;gt;ACD (Avination)&amp;lt;br/&amp;gt;OMC (OpenSim)&amp;lt;br/&amp;gt;USD,EUR,GBP,CHF ([[PayPal]])&amp;lt;br/&amp;gt;USD,EUR,GBP (通过[[Moneybookers]]使用贷记卡或者借记卡。)&amp;lt;br/&amp;gt;USD,EUR,GBP ([[NETELLER]])&amp;lt;br/&amp;gt;EUR (DIRECTebanking / Sofortüberweisung)&amp;lt;br/&amp;gt;USD,EUR,GBP,CHF ([[paysafecard]])&amp;lt;br/&amp;gt;EUR (SEPA 电汇) || BTC&amp;lt;br/&amp;gt;SLL (Second Life)&amp;lt;br/&amp;gt;ACD (Avination)&amp;lt;br/&amp;gt;OMC (OpenSim)&amp;lt;br/&amp;gt;USD,EUR,GBP,CHF ([[PayPal]])&amp;lt;br /&amp;gt;USD,EUR,GBP ([[Moneybookers]])&amp;lt;br/&amp;gt;USD,EUR,GBP ([[NETELLER]])&amp;lt;br/&amp;gt;EUR (SEPA 电汇) || 使用[http://zh.wikipedia.org/wiki/%E7%AC%AC%E4%BA%8C%E4%BA%BA%E7%94%9F 第二人生]中的货币Linden元(高流动性货币)进行交易. 具体交易方式请参见 [[VirWoX]] 词条。&amp;lt;br/&amp;gt;使用Paypal和信用卡付款有一定限制。&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==小额兑换==&lt;br /&gt;
&lt;br /&gt;
对于小额兑换来说，通过银行转账和“[https://www.libertyreserve.com/ 自由储备]”转换交易费用会比较高，并且需要多次转帐，可以通过其他途径兑换。目前在[http://zh.wikipedia.org/wiki/%E6%B7%98%E5%AE%9D 淘宝]上已经有[http://s.taobao.com/search?q=bitcoin 可以兑换比特币的商家]，可以很方便的直接使用[http://zh.wikipedia.org/wiki/%E6%94%AF%E4%BB%98%E5%AE%9D 支付宝]进行兑换。([http://zh.wikipedia.org/wiki/%E6%B7%98%E5%AE%9D 淘宝]与[http://zh.wikipedia.org/wiki/Ebay Ebay]的交易条款不同，可以直接进行虚拟货币兑换)。100BTC以内的比特币可以通过淘宝购买。&lt;br /&gt;
&lt;br /&gt;
==电子钱包（eWallet) ==&lt;br /&gt;
&lt;br /&gt;
比特币客户端在安装后会自动更新块文件，需要较长的时间，并且随着时间的推移，块信息逐渐增多，占用用户大量磁盘空间，因此网上出现了一些[[电子钱包]][[:Category:服务|服务]]。用户可通过[[电子钱包|网络银行]]来替你保存比特币，有些也提供不同兑款方法。&lt;br /&gt;
&lt;br /&gt;
* [[YouTipIt]] 通过PayPal添加款额。&lt;br /&gt;
&lt;br /&gt;
==另请参阅==&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Digital_currencies|Digital Currencies]]&lt;br /&gt;
&lt;br /&gt;
[[Category:兑换]]&lt;br /&gt;
[[Category:Introduction]]&lt;br /&gt;
[[en:Buying bitcoins]]&lt;/div&gt;</summary>
		<author><name>023yangbo</name></author>
	</entry>
	<entry>
		<id>https://zh-cn.bitcoin.it/w/index.php?title=%E8%B4%AD%E4%B9%B0bitcoin&amp;diff=369</id>
		<title>购买bitcoin</title>
		<link rel="alternate" type="text/html" href="https://zh-cn.bitcoin.it/w/index.php?title=%E8%B4%AD%E4%B9%B0bitcoin&amp;diff=369"/>
		<updated>2011-07-30T17:26:19Z</updated>

		<summary type="html">&lt;p&gt;023yangbo：​/* 小额兑换 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;刚开始接触比特币的新手通常对如何才能获得比特币感到疑惑。这篇文章可以除去你的疑惑，给出一些兑换比特币的途径。&lt;br /&gt;
&lt;br /&gt;
==大额兑换==&lt;br /&gt;
&lt;br /&gt;
如果购买比特币的数目较大(1000美元或更多), 可以通过银行电子汇款，自动结算中心转账（ACH），欧洲银行转账，这样可以最大程度的减少换汇的手续费用。或者也可以通过“自由储备”（Liberty Reserve)而进入市场参与交易。同时，你也可以通过这些市场将手中的比特币兑换出去。以下是可以进行比特币在线交易的网站:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 交易商 || 类型 || 充值方式 || 提现方式 || 备注&lt;br /&gt;
|-&lt;br /&gt;
|  [https://www.mtgox.com MtGox] || 交易市场 || BTC&amp;lt;br/&amp;gt;Liberty Reserve USD&amp;lt;br /&amp;gt;USD (电汇)&amp;lt;br /&amp;gt;USD ([[Dwolla]])&amp;lt;br /&amp;gt;USD (ACH)&amp;lt;br /&amp;gt;EUR ([http://en.wikipedia.org/wiki/Single_Euro_Payments_Area SEPA] 电汇)&amp;lt;br /&amp;gt;AUD (电汇)|| BTC&amp;lt;br /&amp;gt;Liberty Reserve USD&amp;lt;br /&amp;gt;USD ([[Dwolla]])&amp;lt;br /&amp;gt;USD (ACH 直接到账)&amp;lt;br /&amp;gt;EUR ([http://en.wikipedia.org/wiki/Single_Euro_Payments_Area SEPA] 电汇) || 提现金额有限制。&lt;br /&gt;
|-&lt;br /&gt;
|  [[Britcoin]] || 交易市场 || BTC&amp;lt;br /&amp;gt;GBP (银行转帐)&amp;lt;br /&amp;gt;[[PokerStars]] USD&amp;lt;br /&amp;gt; || BTC&amp;lt;br /&amp;gt;GBP (银行转帐)&amp;lt;br /&amp;gt;PokerStars USD&amp;lt;br /&amp;gt; ||&lt;br /&gt;
|-&lt;br /&gt;
|  [[Btcex]] || 交易市场 || BTC&amp;lt;br /&amp;gt;USD (国际电汇)&amp;lt;br /&amp;gt;EUR (银行转帐)&amp;lt;br /&amp;gt;JPY (银行转帐)&amp;lt;br /&amp;gt;RUS (RUB, Yandex, WebMoney) || BTC&amp;lt;br /&amp;gt;USD (国际电汇)&amp;lt;br /&amp;gt;EUR (bank transfer)&amp;lt;br /&amp;gt; || 美元在瑞士中转。&amp;lt;br /&amp;gt;欧元在芬兰中转。&amp;lt;br /&amp;gt;RUS (RUB, Yandex, WebMoney).&lt;br /&gt;
|-&lt;br /&gt;
|  [https://www.virwox.com VirWoX] || 交易市场 || BTC&amp;lt;br/&amp;gt;SLL (Second Life)&amp;lt;br/&amp;gt;ACD (Avination)&amp;lt;br/&amp;gt;OMC (OpenSim)&amp;lt;br/&amp;gt;USD,EUR,GBP,CHF ([[PayPal]])&amp;lt;br/&amp;gt;USD,EUR,GBP (通过[[Moneybookers]]使用贷记卡或者借记卡。)&amp;lt;br/&amp;gt;USD,EUR,GBP ([[NETELLER]])&amp;lt;br/&amp;gt;EUR (DIRECTebanking / Sofortüberweisung)&amp;lt;br/&amp;gt;USD,EUR,GBP,CHF ([[paysafecard]])&amp;lt;br/&amp;gt;EUR (SEPA 电汇) || BTC&amp;lt;br/&amp;gt;SLL (Second Life)&amp;lt;br/&amp;gt;ACD (Avination)&amp;lt;br/&amp;gt;OMC (OpenSim)&amp;lt;br/&amp;gt;USD,EUR,GBP,CHF ([[PayPal]])&amp;lt;br /&amp;gt;USD,EUR,GBP ([[Moneybookers]])&amp;lt;br/&amp;gt;USD,EUR,GBP ([[NETELLER]])&amp;lt;br/&amp;gt;EUR (SEPA 电汇) || 使用[http://zh.wikipedia.org/wiki/%E7%AC%AC%E4%BA%8C%E4%BA%BA%E7%94%9F 第二人生]中的货币Linden元(高流动性货币)进行交易. 具体交易方式请参见 [[VirWoX]] 词条。&amp;lt;br/&amp;gt;使用Paypal和信用卡付款有一定限制。&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==小额兑换==&lt;br /&gt;
&lt;br /&gt;
对于小额兑换来说，通过银行转账和“[https://www.libertyreserve.com/ 自由储备]”转换交易费用会比较高，并且需要多次转帐，可以通过其他途径兑换。目前在[http://zh.wikipedia.org/wiki/%E6%B7%98%E5%AE%9D 淘宝]上已经有[http://s.taobao.com/search?q=bitcoin 可以兑换比特币的商家]，可以很方便的直接使用[http://zh.wikipedia.org/wiki/%E6%94%AF%E4%BB%98%E5%AE%9D 支付宝]进行兑换。([http://zh.wikipedia.org/wiki/%E6%B7%98%E5%AE%9D 淘宝]与[http://zh.wikipedia.org/wiki/Ebay Ebay]的交易条款不同，可以直接进行虚拟货币兑换)。100BTC以内的比特币可以通过淘宝购买。&lt;br /&gt;
&lt;br /&gt;
==电子钱包（eWallet) ==&lt;br /&gt;
&lt;br /&gt;
比特币客户端在安装后会自动更新块文件，需要较长的时间，并且随着时间的推移，块信息逐渐增多，占用用户大量磁盘空间，因此网上出现了一些[[电子钱包]][[:Category:服务|服务]]。用户可通过[[电子钱包|网络银行]]来替你保存比特币，有些也提供不同兑款方法。&lt;br /&gt;
&lt;br /&gt;
* [[YouTipIt]] 通过PayPal添加款额。&lt;br /&gt;
&lt;br /&gt;
==另请参阅==&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Digital_currencies|Digital Currencies]]&lt;br /&gt;
&lt;br /&gt;
[[Category:兑换]]&lt;br /&gt;
[[Category:Introduction]]&lt;br /&gt;
[[en:Buying bitcoins]]&lt;/div&gt;</summary>
		<author><name>023yangbo</name></author>
	</entry>
	<entry>
		<id>https://zh-cn.bitcoin.it/w/index.php?title=%E7%94%A8%E6%88%B7:023yangbo&amp;diff=368</id>
		<title>用户:023yangbo</title>
		<link rel="alternate" type="text/html" href="https://zh-cn.bitcoin.it/w/index.php?title=%E7%94%A8%E6%88%B7:023yangbo&amp;diff=368"/>
		<updated>2011-07-30T17:08:47Z</updated>

		<summary type="html">&lt;p&gt;023yangbo：​以内容“擅长到处翻箱倒柜&amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt; 弄了个博客站收集美女图片&amp;lt;br /&amp;gt; :http://www.80sidea.com/&amp;lt;br /&amp;gt; 弄了个淘宝小站业余时间学习&amp;lt;br /&amp;gt; :http:/...”创建新页面&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;擅长到处翻箱倒柜&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
弄了个博客站收集美女图片&amp;lt;br /&amp;gt;&lt;br /&gt;
:http://www.80sidea.com/&amp;lt;br /&amp;gt;&lt;br /&gt;
弄了个淘宝小站业余时间学习&amp;lt;br /&amp;gt;&lt;br /&gt;
:http://shop63192606.taobao.com/&amp;lt;br /&amp;gt;&lt;br /&gt;
:http://4453.taobao.com/&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Contributors Award participant: 1LDAut1mpVbZHGh3dieoVHpV2jVXfyiY4c&lt;/div&gt;</summary>
		<author><name>023yangbo</name></author>
	</entry>
</feed>