Is there an open source (free) client or code for bitcoin transactions

3

Possible Duplicate:
How can I accept bitcoins on my website?

I have a few websites I am working on, but is there an open source code I can use that will allow people to deposit bitcoins on my site to where each user would have a unique deposit address?

midixiewreck

Posted 2011-09-08T23:00:22.077

Reputation: 31

Question was closed 2011-09-13T01:16:10.167

Are you trying to figure out if there's open source code to setup something like mybitcoin? I'm guessing you want to have just one wallet, but have people be able to deposit/withdraw just their bitcoins?

Some clarification on your question would help. – tysat 2011-09-08T23:14:21.217

Answers

0

In the past, I've implemented this just by asking the standard Bitcoin client to generate a few thousand addresses and then just have the web site give them out one by one. It's a bit slow generating the addresses, but if you let it run overnight, you'll have a virtually unlimited supply.

Don't forget to backup the wallet immediately after doing this!

David Schwartz

Posted 2011-09-08T23:00:22.077

Reputation: 46 931

Also there's a Lazy API which seems like an easy way to get going.

Ian Purton 2011-09-09T13:25:23.270

0

Combine the suggestion from @David of pregenerating lots of address with Bitcoin Notify and you can build a system that knows when someone has sent you bitcoins (as part of a checkout process, etc).

Erv Walter

Posted 2011-09-08T23:00:22.077

Reputation: 636

0

This is an excellent service for precisely what you're seeking: http://www.bitcoinpayflow.com/

Erik Voorhees

Posted 2011-09-08T23:00:22.077

Reputation: 204

0

You will need bitcoin-python: https://github.com/toomanysecrets0/bitcoin-python

You will also need MySQLdb

Here's something that should work on a LAMP(ython) server I would sanitize the inputs before putting this in production use though:

#!/usr/bin/env python    

import MySQLdb
import bitcoin
import cgi

DbHost   = "localhost"
DbDatabase = "database name"
DbUser   = "database user"
DbPassword = "database password"

def getAddress(idnumber):

    db = MySQLdb.connect(host=DbHost, user=DbUser, passwd=DbPassword ,db=DbDatabase)

    c=db.cursor()

    c.execute("SELECT * FROM `address` WHERE idnumber=" + "'" + str(idnumber) + "'")

    address = c.fetchone()

    if  address != None:
        returnaddress = address[1]

    else:
        c.execute("SELECT username,idnumber FROM `address` where idnumber=" + "'" + str(idnumber) + "'")
        user = c.fetchone()    
        if  user != None:
            userid = user[0]
            #Generate a new bitcoin address
            newaddress = generateAddress(userid)
            returnaddress = newaddress


            c.execute("INSERT INTO address(idnumber,receiving_address,username) VALUES(" + str(idnumber) + "," + "'" + str(newaddress) + "'" + "," + str(userid) + ")")
    else:
        return "Invalid userid"

return returnaddress

Justin Weeks

Posted 2011-09-08T23:00:22.077

Reputation: 353