7
5
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?
1It 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 – 2012-07-11T07:04:29.110
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'. – 2012-07-11T10:34:35.410
@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 – 2012-07-12T09:17:09.413
@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 – 2012-08-05T16:01:02.850
@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 – 2012-08-05T16:01:32.550
@Globalkeith I don't understand, you let the users sell and buy stuff, but you set they price? – o0'. – 2012-08-05T21:55:52.343