Bitcoin Forum
September 17, 2019, 03:43:42 PM *
News: Latest Bitcoin Core release: 0.18.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to create a coin-flip type address?  (Read 1075 times)
The Goat Master
Hero Member
*****
Offline Offline

Activity: 868
Merit: 502



View Profile
December 25, 2013, 07:56:56 PM
 #1

How would one go in the process of creating an address in which when somebody sent some coins to it, it would have a 50% chance of keeping the coins and a 50% chance of sending double the coins back, provided that the transaction is under half of the current wallet balance?  (Kind of like coinsflip.com, you send and it will send back if you win)

I am interested in claiming some new altcoin bounties.

            ██
         ▄▄▀  ▀▄
        ▄▀▀▄▄▄  ▀▄
      ▄██▄▄▄▄▄██▄▄▀▄
    ▄▀ █  ▄▄▀▀ █  █ ▀▄▄
  ▄▀  ██▀█ ▄▀▀▄ █ █  █▀▄
██   █ █▐▌█ ██ █ ██ █   ██
  ▀▄█  █ █ ▀▄▄▀▄▄███  ▄▀
   ▀▀▄ █▄▄█▄█▀▀   █ ▄▀
      ▀▄▀▀▄▄ ▀▀▀▀██▀
        ▀▄  ▀▀▄▄▄▀
          ▀▄  ▄▀▀
            ██
.
    ▄▄███████▄▄
  ▄███▀▀   ▀▀███▄
 ███▀         ▀▀
███
███
███
 ███▄         ▄▄
  ▀███▄▄   ▄▄███▀
    ▀▀███████▀▀
██████████▄
▀▀▀▀▀▀▀▀▀███▄
          ▀██▌
          ▄██▌
▄▄▄▄▄▄▄▄▄███▀
██████████▀
██▌    ▀███▄
██▌      ▀███▄
██▌        ▀███
█████████████



█████████████



█████████████
        ██
       ████
      ██▌▐██
     ██▌  ▐██
    ██▌    ▐██
   ██▌      ▐██
  ██▌        ▐██
 ██▌          ▐██
██▌    ███████████
██████████████▌
      ██▌
      ██▌
      ██▌
      ██▌
      ██▌
      ██▌
      ██▌
      ██▌
    ▄▄███████▄▄
  ▄███▀▀   ▀▀███▄
 ███▀         ▀███
███             ███
███             ███
███             ███
 ███▄         ▄███
  ▀███▄▄   ▄▄███▀
    ▀▀███████▀▀
██████████▄
▀▀▀▀▀▀▀▀▀███▄
          ▀██▌
          ▄██▌
▄▄▄▄▄▄▄▄▄███▀
██████████▀
██▌    ▀███▄
██▌      ▀███▄
██▌        ▀███



 ▄▄
████
 ▀▀
        ██
       ████
      ██▌▐██
     ██▌  ▐██
    ██▌    ▐██
   ██▌      ▐██
  ██▌        ▐██
 ██▌          ▐██
██▌    ███████████
██▌
██▌
██▌
██▌
██▌
██▌
██▌
██▌
██▌
███
███
███
███
███
███
███
███
███

███
███

███
███
███
███
███
███
███
███
███
███
███

███
███

███
███
.▀▀▀▀▀▀▀▀    WHITEPAPER    ▀▀▀▀▀▀▀▀.
FACEBOOK       REDDIT       TELEGRAM
BITCOINTALK   TWITTER   INSTAGRAM
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1568735022
Hero Member
*
Offline Offline

Posts: 1568735022

View Profile Personal Message (Offline)

Ignore
1568735022
Reply with quote  #2

1568735022
Report to moderator
1568735022
Hero Member
*
Offline Offline

Posts: 1568735022

View Profile Personal Message (Offline)

Ignore
1568735022
Reply with quote  #2

1568735022
Report to moderator
rarkenin
Hero Member
*****
Offline Offline

Activity: 784
Merit: 500



View Profile
December 25, 2013, 09:18:43 PM
 #2

This isn't doable with an address alone, but is easily doable following the same model as most bitcoin-accepting services.

You simply run an instance of bitcoind on your server, and once a transaction comes in, pick true or false in a provably random and fair manner, and send back either nothing or double the amount.
The Goat Master
Hero Member
*****
Offline Offline

Activity: 868
Merit: 502



View Profile
December 26, 2013, 10:20:04 PM
 #3

This isn't doable with an address alone, but is easily doable following the same model as most bitcoin-accepting services.

You simply run an instance of bitcoind on your server, and once a transaction comes in, pick true or false in a provably random and fair manner, and send back either nothing or double the amount.

How do I automate the process though?

            ██
         ▄▄▀  ▀▄
        ▄▀▀▄▄▄  ▀▄
      ▄██▄▄▄▄▄██▄▄▀▄
    ▄▀ █  ▄▄▀▀ █  █ ▀▄▄
  ▄▀  ██▀█ ▄▀▀▄ █ █  █▀▄
██   █ █▐▌█ ██ █ ██ █   ██
  ▀▄█  █ █ ▀▄▄▀▄▄███  ▄▀
   ▀▀▄ █▄▄█▄█▀▀   █ ▄▀
      ▀▄▀▀▄▄ ▀▀▀▀██▀
        ▀▄  ▀▀▄▄▄▀
          ▀▄  ▄▀▀
            ██
.
    ▄▄███████▄▄
  ▄███▀▀   ▀▀███▄
 ███▀         ▀▀
███
███
███
 ███▄         ▄▄
  ▀███▄▄   ▄▄███▀
    ▀▀███████▀▀
██████████▄
▀▀▀▀▀▀▀▀▀███▄
          ▀██▌
          ▄██▌
▄▄▄▄▄▄▄▄▄███▀
██████████▀
██▌    ▀███▄
██▌      ▀███▄
██▌        ▀███
█████████████



█████████████



█████████████
        ██
       ████
      ██▌▐██
     ██▌  ▐██
    ██▌    ▐██
   ██▌      ▐██
  ██▌        ▐██
 ██▌          ▐██
██▌    ███████████
██████████████▌
      ██▌
      ██▌
      ██▌
      ██▌
      ██▌
      ██▌
      ██▌
      ██▌
    ▄▄███████▄▄
  ▄███▀▀   ▀▀███▄
 ███▀         ▀███
███             ███
███             ███
███             ███
 ███▄         ▄███
  ▀███▄▄   ▄▄███▀
    ▀▀███████▀▀
██████████▄
▀▀▀▀▀▀▀▀▀███▄
          ▀██▌
          ▄██▌
▄▄▄▄▄▄▄▄▄███▀
██████████▀
██▌    ▀███▄
██▌      ▀███▄
██▌        ▀███



 ▄▄
████
 ▀▀
        ██
       ████
      ██▌▐██
     ██▌  ▐██
    ██▌    ▐██
   ██▌      ▐██
  ██▌        ▐██
 ██▌          ▐██
██▌    ███████████
██▌
██▌
██▌
██▌
██▌
██▌
██▌
██▌
██▌
███
███
███
███
███
███
███
███
███

███
███

███
███
███
███
███
███
███
███
███
███
███

███
███

███
███
.▀▀▀▀▀▀▀▀    WHITEPAPER    ▀▀▀▀▀▀▀▀.
FACEBOOK       REDDIT       TELEGRAM
BITCOINTALK   TWITTER   INSTAGRAM
rarkenin
Hero Member
*****
Offline Offline

Activity: 784
Merit: 500



View Profile
December 26, 2013, 10:35:19 PM
 #4

You'd write a script or server program to handle it automatically, from something as simple as a loop that waits for txns to come in, to a large operation teeming with cronjobs and database storage for auditing.
fishy
Sr. Member
****
Offline Offline

Activity: 476
Merit: 250


What do you call a fish with no eyes? A Fsh!


View Profile
December 26, 2013, 10:45:30 PM
 #5

You'd write a script or server program to handle it automatically, from something as simple as a loop that waits for txns to come in, to a large operation teeming with cronjobs and database storage for auditing.

Hello.  I am interested in this as well.  What would be a good language to start with for this? PHP?

\   \  \ \\\\\\\\\\\\\\\\◥◣◢◤//////////////// /  /   /
Win88.me ❖ Fair, Trusted Online BTC Gambling ❖
/   /  / ////////////////◢◤◥◣\\\\\\\\\\\\\\\\ \  \   \
rarkenin
Hero Member
*****
Offline Offline

Activity: 784
Merit: 500



View Profile
December 26, 2013, 11:33:45 PM
 #6

Naw, PHP is better for handling individual requests, and is somewhat hard to daemonize. I would recommend Java as you can thus have a coin-game backend and a possible web service meshed together natively. With that said, this isn't something you'd do on your average web host.
hendo420
Sr. Member
****
Offline Offline

Activity: 420
Merit: 250



View Profile WWW
December 27, 2013, 02:21:38 AM
 #7

Its not very hard to do in python.

ebmarket.co
smeagol
Hero Member
*****
Offline Offline

Activity: 966
Merit: 1000


bitclicker.ga


View Profile WWW
December 29, 2013, 11:53:12 PM
 #8

You'd write a script or server program to handle it automatically, from something as simple as a loop that waits for txns to come in, to a large operation teeming with cronjobs and database storage for auditing.

Hello.  I am interested in this as well.  What would be a good language to start with for this? PHP?

Off topic, but why are you still using the inputs sig?

  BITMIXER.IO   High Volume Bitcoin MIXER  
BTC: 1JH2jybjWruvDD23wSe5PCY9Epmr45u6nQ - DVC: 1SMEAGqpm9JSpJ6JZaM5dEBptPTNahpFa - Earn Devcoins by Writing | Devcoin Official Site  | SAT
The Goat Master
Hero Member
*****
Offline Offline

Activity: 868
Merit: 502



View Profile
December 29, 2013, 11:59:47 PM
 #9

Its not very hard to do in python.

How would one do that?

            ██
         ▄▄▀  ▀▄
        ▄▀▀▄▄▄  ▀▄
      ▄██▄▄▄▄▄██▄▄▀▄
    ▄▀ █  ▄▄▀▀ █  █ ▀▄▄
  ▄▀  ██▀█ ▄▀▀▄ █ █  █▀▄
██   █ █▐▌█ ██ █ ██ █   ██
  ▀▄█  █ █ ▀▄▄▀▄▄███  ▄▀
   ▀▀▄ █▄▄█▄█▀▀   █ ▄▀
      ▀▄▀▀▄▄ ▀▀▀▀██▀
        ▀▄  ▀▀▄▄▄▀
          ▀▄  ▄▀▀
            ██
.
    ▄▄███████▄▄
  ▄███▀▀   ▀▀███▄
 ███▀         ▀▀
███
███
███
 ███▄         ▄▄
  ▀███▄▄   ▄▄███▀
    ▀▀███████▀▀
██████████▄
▀▀▀▀▀▀▀▀▀███▄
          ▀██▌
          ▄██▌
▄▄▄▄▄▄▄▄▄███▀
██████████▀
██▌    ▀███▄
██▌      ▀███▄
██▌        ▀███
█████████████



█████████████



█████████████
        ██
       ████
      ██▌▐██
     ██▌  ▐██
    ██▌    ▐██
   ██▌      ▐██
  ██▌        ▐██
 ██▌          ▐██
██▌    ███████████
██████████████▌
      ██▌
      ██▌
      ██▌
      ██▌
      ██▌
      ██▌
      ██▌
      ██▌
    ▄▄███████▄▄
  ▄███▀▀   ▀▀███▄
 ███▀         ▀███
███             ███
███             ███
███             ███
 ███▄         ▄███
  ▀███▄▄   ▄▄███▀
    ▀▀███████▀▀
██████████▄
▀▀▀▀▀▀▀▀▀███▄
          ▀██▌
          ▄██▌
▄▄▄▄▄▄▄▄▄███▀
██████████▀
██▌    ▀███▄
██▌      ▀███▄
██▌        ▀███



 ▄▄
████
 ▀▀
        ██
       ████
      ██▌▐██
     ██▌  ▐██
    ██▌    ▐██
   ██▌      ▐██
  ██▌        ▐██
 ██▌          ▐██
██▌    ███████████
██▌
██▌
██▌
██▌
██▌
██▌
██▌
██▌
██▌
███
███
███
███
███
███
███
███
███

███
███

███
███
███
███
███
███
███
███
███
███
███

███
███

███
███
.▀▀▀▀▀▀▀▀    WHITEPAPER    ▀▀▀▀▀▀▀▀.
FACEBOOK       REDDIT       TELEGRAM
BITCOINTALK   TWITTER   INSTAGRAM
rarkenin
Hero Member
*****
Offline Offline

Activity: 784
Merit: 500



View Profile
December 30, 2013, 12:06:26 AM
 #10

I can always write a Java implementation for you... It would obviously be for a fee but it's not too complex or drawn out, so the fee wouldn't be too bad.
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!