Author

Topic: what bitcoin client to use for website? (Read 960 times)

newbie
Activity: 14
Merit: 0
May 31, 2014, 11:38:51 AM
#14
When you create a new account, you would just assign that to a specific user. You'd then check for updates and update each user's account accordingly. This could be done with a simple array like:

"User" => "Address"

You say "When you create a new account, you would just assign that to a specific user"

What are you referring to when you say "assign that to a specific user"?


1) Generatenewaddress
2) Take that new address and throw it in a database attached to a user
3) Monitor addresses for changes. If one gets a deposit, alter the user's row

You'd run something like this:

UID | UserID | Address

UID = AI, U, int
UserID = U, int
Address = varchar

How user account will be updated and sync.

donator
Activity: 1218
Merit: 1079
Gerald Davis
Yes.  The exact details will vary by application but at a high level the data layer contains the application details (user "balances", deposit addresses, tx history) and bitcoind is merely used as a conduit to connect the application to the bitcoin network.
legendary
Activity: 1988
Merit: 1007
I wanted to create a website where when a user signs up they are given a bitcoin wallet where they can send bitcoins to and from. Does anyone what do sites like nitrogensports.eu and cloudbet.com use?

I read through the blockchain wallet api. Are there any alternatives to that?
This question is probably hard to understand and I may not have used the right words to describe my question. Sorry


The easiest way to do this is bitcoind. You don't even need a database. Just getnewaddress(account) and it will give the address with the account name you put. You can even have an account name that ends with a password hash if you want to have a login system on the site. Then move() to the new address from the main wallet account that is an address with an empty account name string. Now the user has a balance and he can fill it by sending coins to his address. Then if the user withdraws, use sendtoaddress()+move again (and incluode failsafe so he's not allowed to withdraw himself into a negative account balance.

Don't use bitcoind accounts.  They don't scale and once you build a system around it you will be trapped in a technological dead end.  Use bitcoind as a processing engine and handle your user data in the database.

Would my example be more accurate then? My thought is you use bitcoind to make a new address, then use a database to attach that address to a user. When the address has a balance update, you'd just update your user's balance in the database.
donator
Activity: 1218
Merit: 1079
Gerald Davis
I wanted to create a website where when a user signs up they are given a bitcoin wallet where they can send bitcoins to and from. Does anyone what do sites like nitrogensports.eu and cloudbet.com use?

I read through the blockchain wallet api. Are there any alternatives to that?
This question is probably hard to understand and I may not have used the right words to describe my question. Sorry


The easiest way to do this is bitcoind. You don't even need a database. Just getnewaddress(account) and it will give the address with the account name you put. You can even have an account name that ends with a password hash if you want to have a login system on the site. Then move() to the new address from the main wallet account that is an address with an empty account name string. Now the user has a balance and he can fill it by sending coins to his address. Then if the user withdraws, use sendtoaddress()+move again (and incluode failsafe so he's not allowed to withdraw himself into a negative account balance.

Don't use bitcoind accounts.  They don't scale and once you build a system around it you will be trapped in a technological dead end.  Use bitcoind as a processing engine and handle your user data in the database.
newbie
Activity: 53
Merit: 0
I wanted to create a website where when a user signs up they are given a bitcoin wallet where they can send bitcoins to and from. Does anyone what do sites like nitrogensports.eu and cloudbet.com use?

I read through the blockchain wallet api. Are there any alternatives to that?
This question is probably hard to understand and I may not have used the right words to describe my question. Sorry


The easiest way to do this is bitcoind. You don't even need a database. Just getnewaddress(account) and it will give the address with the account name you put. You can even have an account name that ends with a password hash if you want to have a login system on the site. Then move() to the new address from the main wallet account that is an address with an empty account name string. Now the user has a balance and he can fill it by sending coins to his address. Then if the user withdraws, use sendtoaddress()+move again (and incluode failsafe so he's not allowed to withdraw himself into a negative account balance.
legendary
Activity: 1988
Merit: 1007
When you create a new account, you would just assign that to a specific user. You'd then check for updates and update each user's account accordingly. This could be done with a simple array like:

"User" => "Address"

You say "When you create a new account, you would just assign that to a specific user"

What are you referring to when you say "assign that to a specific user"?


1) Generatenewaddress
2) Take that new address and throw it in a database attached to a user
3) Monitor addresses for changes. If one gets a deposit, alter the user's row

You'd run something like this:

UID | UserID | Address

UID = AI, U, int
UserID = U, int
Address = varchar

In "UserID = U, int" what does the "U" stand for. I assume the AI stands for auto-increment.

I understand what you are saying about generating an address and storing in a db but what about when a user wants to withdraw their bitcoins. How would the system know which address to withdraw from?

U is unique (part of being AI).

As for withdrawing, that wouldn't really be relevant in most systems I don't think (this would effectively give a coin mixer by default). If you needed that, though, I think you would just need to create a raw transaction and utilize the inputs from the user's specific address. I don't deal with raw transactions though so I'm not 100% sure on exactly how that's done.
newbie
Activity: 4
Merit: 0
When you create a new account, you would just assign that to a specific user. You'd then check for updates and update each user's account accordingly. This could be done with a simple array like:

"User" => "Address"

You say "When you create a new account, you would just assign that to a specific user"

What are you referring to when you say "assign that to a specific user"?


1) Generatenewaddress
2) Take that new address and throw it in a database attached to a user
3) Monitor addresses for changes. If one gets a deposit, alter the user's row

You'd run something like this:

UID | UserID | Address

UID = AI, U, int
UserID = U, int
Address = varchar

In "UserID = U, int" what does the "U" stand for. I assume the AI stands for auto-increment.

I understand what you are saying about generating an address and storing in a db but what about when a user wants to withdraw their bitcoins. How would the system know which address to withdraw from?
legendary
Activity: 1988
Merit: 1007
When you create a new account, you would just assign that to a specific user. You'd then check for updates and update each user's account accordingly. This could be done with a simple array like:

"User" => "Address"

You say "When you create a new account, you would just assign that to a specific user"

What are you referring to when you say "assign that to a specific user"?


1) Generatenewaddress
2) Take that new address and throw it in a database attached to a user
3) Monitor addresses for changes. If one gets a deposit, alter the user's row

You'd run something like this:

UID | UserID | Address

UID = AI, U, int
UserID = U, int
Address = varchar
newbie
Activity: 4
Merit: 0
When you create a new account, you would just assign that to a specific user. You'd then check for updates and update each user's account accordingly. This could be done with a simple array like:

"User" => "Address"

You say "When you create a new account, you would just assign that to a specific user"

What are you referring to when you say "assign that to a specific user"?
legendary
Activity: 1988
Merit: 1007
I've been reading a little about bitcoind with JSON-RPC. How would I be able to use that to create user wallets/accounts for each person that creates an account on my website?

When you create a new account, you would just assign that to a specific user. You'd then check for updates and update each user's account accordingly. This could be done with a simple array like:

"User" => "Address"
newbie
Activity: 4
Merit: 0
I've been reading a little about bitcoind with JSON-RPC. How would I be able to use that to create user wallets/accounts for each person that creates an account on my website?
full member
Activity: 122
Merit: 100
They used bitcoind and probably using bitcoin api, they have used for deposits and withdrawls, I am not sure big sites like nitrogen or any sports betting would use third party api, they would use a direct way to generate address.
legendary
Activity: 1511
Merit: 1072
quack
You could use Bitcoin Core (bitcoind). Another idea is to use a deterministic wallet (bitcoinj or electrum?) where one private key can be used to generate "infinite" amount of public keys. The bitcoind-approach is probably easier to implement. If you don't want or can't run a Bitcoin node, using blockchain wallet API is a good choice too. You may be able to add extra security with multisig addresses.

Anyway, the most simple solution would be to generate a list of public keys and save them in to a database. When user signs up, assign an address from the pre-generated list to the user.
newbie
Activity: 4
Merit: 0
I wanted to create a website where when a user signs up they are given a bitcoin wallet where they can send bitcoins to and from. Does anyone what do sites like nitrogensports.eu and cloudbet.com use?

I read through the blockchain wallet api. Are there any alternatives to that?
This question is probably hard to understand and I may not have used the right words to describe my question. Sorry
Jump to: