Search content
Sort by

Showing 16 of 16 results by semiel
Post
Topic
Board Announcements (Altcoins)
Re: [ANN][XCP] Counterparty - Pioneering Peer-to-Peer Finance - Official Thread
by
semiel
on 11/12/2014, 04:10:13 UTC
ok, so i think you just need to put in an operator that says that if no one get 6 of 6 then, 5 of 6 inherits the pay out of 6 of 6, and if not 5 of 6 then 4 of 6 inherits the pay out of 5 of 6 and 6 of 6, and so forth.  this way the lotto stays attractive and does not require someone to have $1M to run.

would that be possible for you to add that? please Smiley

Yeah, I can add that. I'm not sure how the probabilities will work out, but it shouldn't be too much of a problem from a technical perspective. I was going to try to make it more modular anyway, so maybe I'll let people plug in their own payout system. (I should probably say that I reserve the right to stop working on this at some point, if it gets to be more work than I signed up for. But for now I'm happy to keeping improving the code, especially since working on my Ethereum scripting skills is something I'd be doing anyway.)


Quote
so the contract is attached to the btc address that runs the contract?  i'm just not understanding the mechanics of how this interfaces with the XCP/BTC system/network so that another address holder (not the initiator of the contract) can purchase a ticket.  so the initiator runs this against counterpartyd (I have to figure out how that works), and then a player would also run this (i think) against his instance of counterpartyd, but what i do not understand is how the player is able to identify the contract on the blockchain to send a message that he is purchasing a ticket against that particular instantiation of the contract.

I know you are not familiar with how XCP works and the ethereum port, so it may be that someone else needs to answer how that actually happens.

Since I don't know how the XCP version works, I can't help you with too many specifics. But think about how transactions work: someone initiates them, but eventually they spread throughout the network. You can point to a specific transaction based on its id, and anyone on the network can see what the transaction was based on their own copy of the blockchain. Contracts are kinda like that. They live "on the blockchain", and anyone can interact with them the same way anyone can send a transaction to any address.
Post
Topic
Board Announcements (Altcoins)
Re: [ANN][XCP] Counterparty - Pioneering Peer-to-Peer Finance - Official Thread
by
semiel
on 11/12/2014, 02:07:09 UTC

also there is one thing i noticed that probably was not clear from all of the write ups,  but the award sizes should actually be a percentage of the total amount in tickets collected not set amounts like in the powerball.  would it be difficult for you to adjust this?  that is what I meant by picking a distribution method/algo. sorry i am not super good at reading code.

Code:
Send an appropriate amount of funds to support the prizes you are configuring. Because Powerball-style lotteries have set prizes, you cannot rely on ticket sales to cover payouts.
 

for example, getting all numbers correct gets 50% of total (split evenly if multiple tickets), 5 of 6 gets 30%, 4 of 6 gets 10%, 3 of 6 gets 7%, 2 of 6 gets 3%, 1 of 5 gets 0%.

It should be fairly easy to modify the code to work that way. However, I strongly recommend against it. That would make the game completely undesirable to play.

Think about it this way: Your chance of getting a jackpot is 1 in 175,223,510. That's true no matter who else plays, or how much the prize is. Because of that, there's only one value that's a "fair" payout for a jackpot: 175,223,510 times the cost of a ticket, minus the house's cut.

You're never, ever going to sell 175,223,510 tickets for your lottery, at least not until you're as big as real Powerball. Because of that, you simply won't bring in enough money in tickets to make the jackpot attractive. Imagine the first person to buy a ticket: they'll have a 1:175,223,510 chance of hitting the jackpot, and their expected payout if they do will be half the cost of the ticket they just bought...

Luckily, your chances of having to pay out are equally low, so if you set the payouts correctly and buy insurance/have the money lent to you/whatever you can expect a profitable return on average over time.

Quote
also another question regarding the "buy ticket" command

if there are multiple lotto's running, how does a buyer know which contract to buy the lotto ticket from?  or is all that  handled at the XCP layer?

sorry for all the noobish sounding questions but i'm using this as an excerise to learn how this ethereum stuff works

Each contract can only run one lotto at a time, as currently set up. If you had a system with lots of lottos running simultaneously, you'd probably want to maintain a list of lotto contracts, maybe with some sort of way of automatically registering and displaying them. They'll have a static address, so you can always "find" it once you know where to look for it.
Post
Topic
Board Announcements (Altcoins)
Re: [ANN][XCP] Counterparty - Pioneering Peer-to-Peer Finance - Official Thread
by
semiel
on 11/12/2014, 00:36:10 UTC
Received contributions of 10, 5, and 2 XCP. Thanks ianspain, dante, and (presumably) niceplum!

I got Joris to send me his XCP address and add it to the gist. I've just sent him 22.4 XCP, which is 20% of the expected 112 (including dante's contribution).

More importantly, I've pushed a fix to a bug we missed. Until the fix, you were able to create tickets with repeated numbers, which would have much better odds than normal tickets.

I'm a broken record on this, but thanks to everyone who participated! It's pretty thrilling to be able to make a little money by working with random strangers who want to push this technology forward. Smiley
Post
Topic
Board Announcements (Altcoins)
Re: [ANN][XCP] Counterparty - Pioneering Peer-to-Peer Finance - Official Thread
by
semiel
on 10/12/2014, 00:36:28 UTC
tx finally went through

f06352ccd03301c9f40edbce625b6f97eb18ce49a0403be1b089e1983699c79c

http://blockscan.com/tx?txhash=f06352ccd03301c9f40edbce625b6f97eb18ce49a0403be1b089e1983699c79c

also i got one of the pledgees amounts incorrect, so the total you should receive is 110, not 115.  Sorry about was taking number from here and from skype chats and apparently got confused.

I can confirm I got the 50 XCP, plus two separate 10 XCP transactions. Thanks, prophetx, ivana, and mysterious third person!

I'll bug Joris for his address and forward him 20% of whatever I end up receiving. Smiley
Post
Topic
Board Announcements (Altcoins)
Re: [ANN][XCP] Counterparty - Pioneering Peer-to-Peer Finance - Official Thread
by
semiel
on 09/12/2014, 04:00:40 UTC
Can you reply to this post with your XCP/BTC address.

Then I will send the link to the people who pledged to support your coding of this smart contract.

Here you go: 1LeygZteCpjBstARoyt3uHgPhV8aJHsBAg

Again, thank you so much for setting this up! I think this is the first cryptocurrency I've actually earned, rather than buying. Smiley

Quote
Also, as I didn't explicit a reward for the code review, if you would not mind perhaps sharing a % of it to the person who did the code review.  https://gist.github.com/jorisbontje/353f69515a16cef7de7b I will ask him to put his XCP/BTC address in the git repo.

I was definitely planning to pass some of the bounty to the code reviewer. As I said, it was a very good and thorough review. Does 20% seem fair to everyone?

Let me know if you have any other smart contract work you need done. Wink And I'm still planning on trying out some code improvements over the next few days. I'll be happy to help debug if you run into any issues with your testing.
Post
Topic
Board Announcements (Altcoins)
Re: [ANN][XCP] Counterparty - Pioneering Peer-to-Peer Finance - Official Thread
by
semiel
on 09/12/2014, 01:28:13 UTC
Thank you for the thorough review! I'll take a look at addressing the issues when I get the chance. (Might be a day or so.)

Update: I've made some quick fixes for the two issues identified as blockers. I've added test cases for both, and they're both pushed to the repo:

https://github.com/PeterBorah/ethereum-powerball

That might be enough to fulfill the conditions of the bounty. However, as a matter of professional pride, I want to spend a little more time working on the quality of the code. The sorts of bugs found reveal what the weak spots are, and I have some ideas for making it more robust.* So, I'm going to try to work on that over the next couple evenings.

* For the programmers in the audience: I've basically got an implicit state machine with some pretty complex effects. I want to model it more directly so that it's easier to reason about and harder to end up in weird partial states. I'm also not dealing with storing data in a very principled way, so I want to think about encapsulating some of that.
Post
Topic
Board Announcements (Altcoins)
Re: [ANN][XCP] Counterparty - Pioneering Peer-to-Peer Finance - Official Thread
by
semiel
on 08/12/2014, 16:34:31 UTC
Thank you for the thorough review! I'll take a look at addressing the issues when I get the chance. (Might be a day or so.)
Post
Topic
Board Announcements (Altcoins)
Re: [ANN][XCP] Counterparty - Pioneering Peer-to-Peer Finance - Official Thread
by
semiel
on 08/12/2014, 01:56:55 UTC
Especially with the introduction of multisig, it would be a cool idea to build a relatively simple 'smart contract' kickstarter/reverse kickstarter on top of CounterParty, where community can collaboratively chip in funds to realise the development of smart contract dApps.

This is a really good idea, and luckily very easy to do. "Kickstarter"-style contracts have become a really common proof-of-concept in the Ethereum world. Here's one in Serpent:

https://github.com/ethereum/serpent/blob/poc7/examples/crowdfund.se

And one in the upcoming Solidity language:

https://github.com/chriseth/cpp-ethereum/wiki/Crowdfunding-example-contract-in-Solidity
Post
Topic
Board Announcements (Altcoins)
Re: [ANN][XCP] Counterparty - Pioneering Peer-to-Peer Finance - Official Thread
by
semiel
on 07/12/2014, 23:20:04 UTC
yes the prize amounts cannot be the same as powerball since it is unrealistic to use fixed pay outs unless this is being done by a large entity who already has the funds.  the payout as i mentioned above should ensure that at least 33% of the tickets get something.  does it do that?

You're going to need a big bankroll regardless, if you want to run any sort of lottery. That's because, by definition, if you're working with fixed probabilities there's no guarantee reality will follow exactly the expected distribution. What if only one person enters, and they win a prize? (The situation is different with a raffle, where the probabilities and payouts change together.) Real lotteries solve this problem by buying insurance and things like that.

I originally followed the probabilities of the real Powerball for payouts, which means that you have about a 1/35 chance of winning a prize. I just pushed a change giving the ability to payout on fewer matched numbers, so that you can bring that number down if you like. If you give a small payout for even a single match, my back of the envelope calculations say people should have about a 50% chance of winning. Smiley

cool thanks!

Hopefully one of the dev's can check your code soon, so you can get the award.  I'll keep bugging them but I guess it is the weekend.  



No worries! Thanks for setting this all up!

I should say, if there's anything you don't like about the way I interpreted the spec, let me know. I'm happy to make any tweaks that are necessary. I want everyone on both sides to feel good about how this went. Smiley
Post
Topic
Board Announcements (Altcoins)
Re: [ANN][XCP] Counterparty - Pioneering Peer-to-Peer Finance - Official Thread
by
semiel
on 07/12/2014, 18:46:31 UTC
yes the prize amounts cannot be the same as powerball since it is unrealistic to use fixed pay outs unless this is being done by a large entity who already has the funds.  the payout as i mentioned above should ensure that at least 33% of the tickets get something.  does it do that?

You're going to need a big bankroll regardless, if you want to run any sort of lottery. That's because, by definition, if you're working with fixed probabilities there's no guarantee reality will follow exactly the expected distribution. What if only one person enters, and they win a prize? (The situation is different with a raffle, where the probabilities and payouts change together.) Real lotteries solve this problem by buying insurance and things like that.

I originally followed the probabilities of the real Powerball for payouts, which means that you have about a 1/35 chance of winning a prize. I just pushed a change giving the ability to payout on fewer matched numbers, so that you can bring that number down if you like. If you give a small payout for even a single match, my back of the envelope calculations say people should have about a 50% chance of winning. Smiley
Post
Topic
Board Announcements (Altcoins)
Re: [ANN][XCP] Counterparty - Pioneering Peer-to-Peer Finance - Official Thread
by
semiel
on 07/12/2014, 07:43:55 UTC
Alright, here we go! I've got a fairly polished proof of concept up on Github:

https://github.com/PeterBorah/ethereum-powerball

Instructions for use are in the readme.

I've got a decent number of automated tests for it. Obviously any script that gets banged out in an afternoon is likely to have some residual bugs, but hopefully I've tested it sufficiently that there won't be any major problems.

It hits almost all of the points of the spec, and tries to be very close to the way Powerball works. (Powerball has some weird features, like every prize except the jackpot being fixed, and pretty complex rules for how the jackpot works.) I went with requiring people to claim the prize, since that's what prophetx requested, but of course that could be easily changed.

There is one small deviation from the spec: the ability to set the number of balls. This turned out to be surprisingly difficult, since Serpent doesn't deal well with not knowing how many values there will be ahead of time. However, you can set the payouts for each prize, and by switching out the RNG you can change how many possible values there are for each ball. And of course it would be very easy to modify the code to use, e.g., four balls instead of five.

If that's a dealbreaker, maybe someone can try to add that support, and split the bounty with me. Wink Or maybe prophetx will decide it's good enough as is.

Either way, thanks for the interesting challenge!

Best,
Peter
XCP: 1LeygZteCpjBstARoyt3uHgPhV8aJHsBAg
Post
Topic
Board Announcements (Altcoins)
Re: [ANN][XCP] Counterparty - Pioneering Peer-to-Peer Finance - Official Thread
by
semiel
on 06/12/2014, 23:35:51 UTC
I've been working on this all afternoon, and I'm reasonably close to done (though I might not get to finish until tomorrow). When I'm done, how should I submit my entry? Just post a github link here?
Post
Topic
Board Announcements (Altcoins)
Re: [ANN][XCP] Counterparty - Pioneering Peer-to-Peer Finance - Official Thread
by
semiel
on 06/12/2014, 17:37:53 UTC
Thanks, Equality 7-2521!

A couple questions on the spec.

it should distribute the winning based on how many numbers people get X of Y numbers (similar to how state lottos work)

Should there be a "powerball" number with better odds, like in the link you provided?

Quote
it should allow users to redeem tickets
it should set limits for when tickets can be redeemed

You prefer explicit redemption, rather than having it automatically send everyone their winnings?

EDIT: New question:

Should it pay out percentages of ticket sales (Jackpot is 50% of winnings, etc.), or should it have set prizes the way real Powerball apparently works (4 out of 5 plus the powerball gets you $10k)?
Post
Topic
Board Announcements (Altcoins)
Re: [ANN][XCP] Counterparty - Pioneering Peer-to-Peer Finance - Official Thread
by
semiel
on 06/12/2014, 17:12:32 UTC
Hey all, this is Semiel from the Ethereum forums. I'm going to take a crack at the Powerball contract this afternoon. Can anyone point me to documentation about how XCP's smart contract implementation differs from Ethereum's? I know how to do it with Ether and the Ethereum blockchain, but I don't know what I need to do to make it work with XCP and the Bitcoin blockchain.
Post
Topic
Board Altcoin Discussion
Re: What Would You Want In A Coin? - 2015
by
semiel
on 20/11/2014, 16:32:54 UTC
I predict that the only thing that will matter in a few years is how good a currency's smart contract implementation is. There are lots of other things that make some cryptos better or worse than others, but the runaway technological explosion that will happen when some smart contract system catches on will quickly make all the other variables irrelevant.
Post
Topic
Board Announcements (Altcoins)
Re: [ANN] [ETC] Ethercoin | Redeemable 1:1 for ethers | Official Thread
by
semiel
on 19/11/2014, 21:33:26 UTC
Impossible to be a scam since we're happy to use escrow.

It's worth pointing out that there is a common scam where people offer two services: one is trust-free and can't be a scam, and the other requires trust. They use the legitimacy of the first in order to convince people to use the second, and then run off with the second group's money.

I'm not saying that's what you're doing here, but it makes me nervous that you aren't defaulting to escrow in all cases.