Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: Markus11 on June 04, 2013, 02:20:19 AM



Title: Can someone explain me a automatically payout system
Post by: Markus11 on June 04, 2013, 02:20:19 AM
Hello,
Can someone please explain me how a automatically payout system works?
Example site: http://satoshidice.com
Winner will receive theyr winning automatically paid out to theyr senders adress

Thx alot


Title: Re: Can someone explain me a automatically payout system
Post by: Stephen Gornick on June 04, 2013, 02:36:08 AM
Winner will receive theyr winning automatically paid out to theyr senders adress

That's because SatoshiDICE has a restriction that any wagers sent from a hosted (shared) E-Wallet are lost (or, more specifically, the winnings will be paid just that they go to someone else and not to the person who sent the wager payment).

This is because the Bitcoin protocol doesn't have the concept of a Sender's address.

Bitcoin has INPUTs and OUTPUTs.

So SatoshiDICE is grabbing from the wager transaction the INPUT (or choosing one of the INPUTs if there are multiple that funded the wager payment) and using that as the Bitcoin address to send the funds to on the payout transaction.

And they'll always use the OUTPUT from the wager transaction as one of the INPUTs in the return payout such that if the wager never confirms (or is double spent) then the payout transaction will never confirm either.

So they don't have payouts that will confirm on wager payments that did not confirm.

On the backend they use a customize version of BitcoinJ to perform the payments, reportedly.


Title: Re: Can someone explain me a automatically payout system
Post by: Markus11 on June 04, 2013, 03:00:05 AM
Thx alot, i asked because i want to make (with help from a web designer + programmer) a little game where winnings should be paid automatically to the players adress he send his bet from.
Any ideas how to make this the easy way?

Thx alot


Title: Re: Can someone explain me a automatically payout system
Post by: DannyHamilton on June 04, 2013, 06:14:22 AM
Thx alot, i asked because i want to make (with help from a web designer + programmer) a little game where winnings should be paid automatically to the players adress he send his bet from.
Any ideas how to make this the easy way?

Thx alot
This is a BAD IDEA.

It would be a MUCH BETTER IDEA to have your website request from the player an address where they would like the bitcoins sent.


Title: Re: Can someone explain me a automatically payout system
Post by: Markus11 on June 04, 2013, 06:32:14 AM
Why?
I wanted to provide ONE address where all player can send money to.
Winnings should be automatically paid out to the senders adress.

Thx alot


Title: Re: Can someone explain me a automatically payout system
Post by: DannyHamilton on June 04, 2013, 07:36:33 AM
There are many situations where the sender does not control the address that the bitcoins are sent from.  If you send back to that address, then the sender will not receive them.

You can provide a single address to receive the money if you want (although I'd use a new address for each transaction if I was offering the service), but you should ask the user to provide an address where they want to receive their winnings.


Title: Re: Can someone explain me a automatically payout system
Post by: CoinBomb on June 04, 2013, 07:47:47 AM
take the TX of the payments in, get the outputs. create a new transaction chaining that output (as an input) to a new transaction.

the bitcoind functions you'll need to look at revolve around raw transactions. (get, create, sign, send)


Title: Re: Can someone explain me a automatically payout system
Post by: Markus11 on June 04, 2013, 07:59:20 AM
Ok, but i specifically point out that the address the sender sends money from MUST be able to receive payments, wouldnt that solve the problem?


Title: Re: Can someone explain me a automatically payout system
Post by: CIYAM on June 04, 2013, 08:04:49 AM
Ok, but i specifically point out that the address the sender sends money from MUST be able to receive payments, wouldnt that solve the problem?

If the user doesn't understand how Bitcoin works it won't but if you are dead keen on doing this then I don't expect anyone here will be able to talk you out of it.


Title: Re: Can someone explain me a automatically payout system
Post by: Markus11 on June 04, 2013, 08:17:05 AM
;-) thx alot!
A last question, hope i can explain it understandable (poor englisch)

AS mentioned i want to create a little game (with the help of a web designer/programmer)
-) Around 10k payout transfers to winners

How to handle that if a THIRD PARTY is involveved?
He would need the private key (which i dont want to give away) for automatism payout process
10k transfers are to much to manually ...

Any suggestions?

Thx 1000 times


Title: Re: Can someone explain me a automatically payout system
Post by: Markus11 on June 04, 2013, 08:34:34 AM
Quote
If the user doesn't understand how Bitcoin works
Then he also will not understand why he has to send coins to a adress provided on the page (how to receive winnings), or am i false?


Title: Re: Can someone explain me a automatically payout system
Post by: CIYAM on June 04, 2013, 08:37:01 AM
Then he also will not understand why he has to send coins to a adress provided on the page (how to receive winnings), or am i false?

People can "drive a car" without even knowing what kind of fuel its engine uses - can't they?

(i.e. just because someone might not know about whether the wallet they are using can accept payments back to the UTXO addresses being used in a tx doesn't mean that they don't know how to *send BTC* to an address)


Title: Re: Can someone explain me a automatically payout system
Post by: Markus11 on June 04, 2013, 09:02:34 AM
Ok, so you would advice providing multiple adresses like a bulk wallet, each for every player/transaction?
Thx alot


Title: Re: Can someone explain me a automatically payout system
Post by: CIYAM on June 04, 2013, 09:15:45 AM
Ok, so you would advice providing multiple adresses like a bulk wallet, each for every player/transaction?

I guess it really depends upon how you want your game to *work* in regards to the user experience - it doesn't seem like much to ask for a "payout" address (*per session* if not *per account*) making it then possible for people to use your game even with hosted wallets (or perhaps make it optional with a warning that if you *don't* provide a *payout* address then the payout may go to someone else if you are using a hosted wallet).


Title: Re: Can someone explain me a automatically payout system
Post by: Markus11 on June 04, 2013, 09:43:18 AM
Overall there will be exactly 10k single payouts, then the game is over
Im simply looking for the easiest way to realize that in an automatically way.


Title: Re: Can someone explain me a automatically payout system
Post by: Markus11 on June 04, 2013, 03:34:21 PM
*push