<p>You need to set up bitcoind and look into <a href="https://en.bitcoin.it/wiki/Accounts_explained" rel="nofollow">accounts</a>. If you want users to be able to pay each other in the system for anything, it is quite easy to move Bitcoins around without creating transactions simply by calling the <a href="https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list" rel="nofollow"><code>move</code> API</a>. After that you just need to add the options for users to put money into their accounts and withdraw them, and you are set.</p>

<p>Can't really help you with Ruby-specific things though, as I don't know the language.</p>

CC BY-SA 3.0
2014-09-16T03:54:48.587Z
From the wiki: Account Weaknesses
...
Wallet backups are an issue; ...a backup must be done every time an address is associated with an account and every time the 'move' command is used.

..does not scale up to thousands of accounts with tens of thousands of transactions...

It is awkward at best to keep the bitcoin-maintained Berkely DB wallet database and the application database backed up and synchronized at all times.
dangerous.beans
CC BY-SA 3.0
2012-07-11T04:18:46.823Z
2012-07-11T04:18:46.823Z
ThePiachu
<p>The satoshi bitcoin client doesn't currently support multiple wallets.</p>

<p>The way that website backends typically interact with bitcoin is through the bitcoind daemon.</p>

<p>Here's a brief overview of how you can handle the interaction:</p>

<p>When a customer wants to deposit bitcoins with you, run <code>bitcoind getaccountaddress &lt;userid&gt;</code> to get a deposit address and associate it with their userid.</p>

<p>To see which users have sufficiently confirmed deposits, run <code>bitcoind listaccounts &lt;conf&gt;</code> where <code>conf</code> is the number of confirmations you require.  That will give you the balance of each user's account only considering deposits with enough confirmations.</p>

<p>For each deposit once it's confirmed enough, use <code>bitcoind move &lt;userid&gt; admin &lt;amount&gt;</code> to move the deposit from the user's bitcoin account to an account called <code>admin</code> and process the deposit (the same as you do once a credit card payment is received - send them the goods, or whatever).  The <code>move</code> will stop the deposit showing up again next time you run <code>listaccounts</code>.</p>

CC BY-SA 3.0
2012-07-11T05:24:40.530Z
2012-07-11T05:24:40.530Z
Chris Moore
<p>I have a website which enables users to trade information for a price.
The price is calculated based on an algorithm within the website.
The website charges a percentage per transaction for the service.</p>

<p>I would like to know how to go about enabling the users to perform the transaction using bitcoins as an alternative to credit card transactions.</p>

<p>The website is coded in Ruby on Rails, I am currently investigating bitcoind, and the bitcoin-ruby library but I'm feeling a little overwhelmed with new technology. </p>

<p>Could someone please explain how I might go this? I'm looking for an overview of the process.</p>

<p>For example: The website connects to a bitcoind server, and creates a unique wallet per user, then to provide transactions the users will need to transfer coins from somewhere to their personal website wallet. When the user wishes to purchase information from another user, the website then connects to the bitcoind and creates a transaction between the two wallets, and creates a second transaction to cover the website commision.</p>

<p>I've made up this example from my basic understanding of the system - but what security issues are involved in this. Will this approach work, or is there a better way?</p>

CC BY-SA 3.0
2012-07-11T07:04:29.110Z
It may help you to think about the problem a little differently. All you really need to do is process deposits and withdrawals. Then you can track bitcoin balances in your own database. When someone does a deposit, you bump their balance in your database (and the bitcoins go in *your* wallet). Moving coins from one user to another is just done in your database. When someone does a withdrawal, you pay them from your wallet to the withdrawal address they specify. (Whatever you do though, don't forget about security!)
David Schwartz
CC BY-SA 3.0
2012-07-11T10:34:35.410Z
OT: _"enables users to trade information for a price. The price is calculated based on an algorithm within the website"_ <-- why don't you let the users set the price?
o0'.
CC BY-SA 3.0
2012-07-12T09:17:09.413Z
@Lohoris: That's probably what he does. For example, if he uses an auction, that's an algorithm within the website that lets the users set the price.
David Schwartz
CC BY-SA 3.0
2012-08-05T16:01:02.850Z
@DavidSchwartz If I understand you correctly, the website only has one wallet and the "portion" of the wallet owned by the user is stored in the database? Sounds interesting, and probably a simpler implementation - thanks!!
ktec
CC BY-SA 3.0
2012-08-05T16:01:32.550Z
@Lohoris the value of information is based on users reputation - clearly I'm not going to allow users to directly set their own reputation.
ktec
CC BY-SA 3.0
2012-08-05T21:55:52.343Z
@Globalkeith I don't understand, you let the users sell and buy stuff, but you set they price?
o0'.
<transactions><development><bitcoind><website-integration>
How to enable website users to transact with each other using bitcoins?
ktec
# How to enable website users to transact with each other using bitcoins?

(Asked by: username_0 on 2012-07-11)

I have a website which enables users to trade information for a price.
The price is calculated based on an algorithm within the website.
The website charges a percentage per transaction for the service.

I would like to know how to go about enabling the users to perform the transaction using bitcoins as an alternative to credit card transactions.

The website is coded in Ruby on Rails, I am currently investigating bitcoind, and the bitcoin-ruby library but I'm feeling a little overwhelmed with new technology.

Could someone please explain how I might go this? I'm looking for an overview of the process.

For example: The website connects to a bitcoind server, and creates a unique wallet per user, then to provide transactions the users will need to transfer coins from somewhere to their personal website wallet. When the user wishes to purchase information from another user, the website then connects to the bitcoind and creates a transaction between the two wallets, and creates a second transaction to cover the website commision.

I've made up this example from my basic understanding of the system - but what security issues are involved in this. Will this approach work, or is there a better way?

**Tags:** transactions, development, bitcoind, website-integration

> **Comments:**
> **username_1**: It may help you to think about the problem a little differently. All you really need to do is process deposits and withdrawals. Then you can track bitcoin balances in your own database. When someone does a deposit, you bump their balance in your database (and the bitcoins go in *your* wallet). Moving coins from one user to another is just done in your database. When someone does a withdrawal, you pay them from your wallet to the withdrawal address they specify. (Whatever you do though, don't forget about security!)  
> **username_2**: OT: _"enables users to trade information for a price. The price is calculated based on an algorithm within the website"_ <-- why don't you let the users set the price?  
> **username_1**: @Lohoris: That's probably what he does. For example, if he uses an auction, that's an algorithm within the website that lets the users set the price.  
> **username_0**: @username_1 If I understand you correctly, the website only has one wallet and the "portion" of the wallet owned by the user is stored in the database? Sounds interesting, and probably a simpler implementation - thanks!!  
> **username_0**: @Lohoris the value of information is based on users reputation - clearly I'm not going to allow users to directly set their own reputation.  
> **username_2**: @Globalkeith I don't understand, you let the users sell and buy stuff, but you set they price?  

---

## 2 answers

### Answer by username_3 on 2012-07-11. Score: 4

You need to set up bitcoind and look into [accounts](https://en.bitcoin.it/wiki/Accounts_explained). If you want users to be able to pay each other in the system for anything, it is quite easy to move Bitcoins around without creating transactions simply by calling the [`move` API](https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list). After that you just need to add the options for users to put money into their accounts and withdraw them, and you are set.

Can't really help you with Ruby-specific things though, as I don't know the language.

> **Comments:**
> **username_4**: From the wiki: Account Weaknesses ... Wallet backups are an issue; ...a backup must be done every time an address is associated with an account and every time the 'move' command is used.  ..does not scale up to thousands of accounts with tens of thousands of transactions...  It is awkward at best to keep the bitcoin-maintained Berkely DB wallet database and the application database backed up and synchronized at all times.  

---

### Answer by username_5 on 2012-07-11. Score: 1

The satoshi bitcoin client doesn't currently support multiple wallets.

The way that website backends typically interact with bitcoin is through the bitcoind daemon.

Here's a brief overview of how you can handle the interaction:

When a customer wants to deposit bitcoins with you, run `bitcoind getaccountaddress <userid>` to get a deposit address and associate it with their userid.

To see which users have sufficiently confirmed deposits, run `bitcoind listaccounts <conf>` where `conf` is the number of confirmations you require. That will give you the balance of each user's account only considering deposits with enough confirmations.

For each deposit once it's confirmed enough, use `bitcoind move <userid> admin <amount>` to move the deposit from the user's bitcoin account to an account called `admin` and process the deposit (the same as you do once a credit card payment is received - send them the goods, or whatever). The `move` will stop the deposit showing up again next time you run `listaccounts`.


---

