Author [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: Bitshares Play two layers design  (Read 964 times)

0 Members and 1 Guest are viewing this topic.

Offline HackFisher

  • Moderator
  • Hero Member
  • *****
  • Posts: 883
    • View Profile
Bitshares Play two layers design
« on: March 31, 2014, 07:24:16 AM »

Here some ideas to share with you. If you are going to create new DAC based on Bitshares Play, this info might be helpful to you to save your time.

I would like to design play in two abstract layers, the rule layer and the core layer, which will make it very easy to create a alt-play, for play family dac creator.

First, The rule layer is all about the game rule of the play, x of y, or serveral independ color balls with different total and k to select, similar the options in https://bitsharestalk.org/index.php?topic=3818.0

And the play family Dac creators can select whatever kind of rule they like, color counts, ball count, k to select, prize definition. The outer rule layer will also provide simple api for inheritors to customize prizes rules.

Meta data of this rule layer can be described as following json data, inherit DACs could customize it to create alt-play.
{
    version: 1,
    id: 1
    name: "double-color ball lottory",
    rule: {
        balls: [
                {N: 35, k: 5},
                {N: 12, k: 2}
            ],
        prizes: [
                {level: 1, match: [[5, 2]]},
                {level: 2, match: [[5, 1]]},
                {level: 3, match: [[5, 0]]},
                {level: 4, match: [[4, 2]]},
                {level: 5, match: [[4, 1]]},
                {level: 6, match: [[4, 0], [3, 2]]},
                {level: 7, match: [[3, 1], [2, 2]]},
                {leve;: 8, match: [[3, 0], [1, 2], [2, 1], [0, 2]]}
            ]
    }
}

Second, the core layer is nothing but a true random number decentralized raffle process protected by mining, blockchain db etc.
« Last Edit: August 12, 2014, 12:39:35 AM by HackFisher »
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

bitbro

  • Guest
Re: Lotto two layers design
« Reply #1 on: March 31, 2014, 02:39:48 PM »
Would this help as foundation for BitShares Lotto family DACs such as BitShares Vegas?


Sent from my iPhone using Tapatalk

Offline ssjpts

Re: Lotto two layers design
« Reply #2 on: March 31, 2014, 02:58:13 PM »
 +5%如果附上中文版的会不会更好?
新浪微博:剑指未来BTS
BTC:1Bc7gRGotktBmnNFr3BUUM22HFXCCTyxor
BTSX ID:loves,集大众之爱,待到BTS 500刀,10%回退给捐赠者,10%用于运营,剩余80%用于爱心事业和BTS宣传推广。

Offline HackFisher

  • Moderator
  • Hero Member
  • *****
  • Posts: 883
    • View Profile
Re: Lotto two layers design
« Reply #3 on: March 31, 2014, 03:31:09 PM »
+5%如果附上中文版的会不会更好?

因为这里不是中文版,时间也有限,所以没有附上中文。

weibo(chinese twitter) @BTS_Newsroomhttp://weibo.com/u/5059757864 有简单精炼的翻译, 如下
Quote
【Lotto】开发者将lotto抽象成两层,规则与核心。规则层将提供简单易用的api供第三方扩展,如果真是按帖子说的那样,就真的是太简单了,自己定义好彩票类型与中奖方式就可以了;核心层则是基于区块链的分布式的随机数抽取过程。http://t.cn/8sMMkQw
« Last Edit: March 31, 2014, 03:40:53 PM by HackFisher »
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline HackFisher

  • Moderator
  • Hero Member
  • *****
  • Posts: 883
    • View Profile
Re: Lotto two layers design
« Reply #4 on: March 31, 2014, 03:40:18 PM »
Would this help as foundation for BitShares Lotto family DACs such as BitShares Vegas?


Sent from my iPhone using Tapatalk

Are you mean "Bitshares Vegas" this?
https://bitsharestalk.org/index.php?topic=3621.msg47479#msg47479

This design has not considered the market of data feed in yet, I think it's mainly for lottery and dice category.
« Last Edit: March 31, 2014, 03:41:49 PM by HackFisher »
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline alt

Re: Lotto two layers design
« Reply #5 on: March 31, 2014, 03:52:36 PM »

I am wondering why do you want to descripe the rule layer with json file?
I think it's enough to implement it with c++, and it will be more flexible.

Offline HackFisher

  • Moderator
  • Hero Member
  • *****
  • Posts: 883
    • View Profile
Re: Lotto two layers design
« Reply #6 on: March 31, 2014, 04:01:35 PM »

I am wondering why do you want to descripe the rule layer with json file?
I think it's enough to implement it with c++, and it will be more flexible.

Yes, c++ is more flexible, I do experiment to see how easy it can be extended. Data structure is more straightforward, I'll make compromise to use both or just C++ api if  being easy and flexibility can not be acheived them same time.

At present, this json file is just as config file for default Bitshares lotto DAC to release.
« Last Edit: March 31, 2014, 04:06:19 PM by HackFisher »
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline alt

Re: Lotto two layers design
« Reply #7 on: March 31, 2014, 04:06:18 PM »

I am wondering why do you want to descripe the rule layer with json file?
I think it's enough to implement it with c++, and it will be more flexible.

Yes, c++ is more flexible, I'm just do experiment to see how easy it can be extended. Data structure is more straightforward, I'll make compromise to use both or just C++ api if  can not be acheived.

At present, this json file is just as config file for default Bitshares lotto DAC to release.
good job, two layers design is good!

Offline zhangweis

  • Sr. Member
  • ****
  • Posts: 283
    • View Profile
Re: Lotto two layers design
« Reply #8 on: April 02, 2014, 05:12:34 PM »
Second, the core layer is nothing but a true random number decentralized raffle process protected by mining, blockchain db etc.

If we need some kind of POW for randomness, why not directly use bitcoin blockchain? The random number can be something like the future nth block's hash. As bitcoin mining involves randomness, it's more secure for a random number generation. The block's hash is difficult to find and it will be difficult for a miner to adjust the hash to his will (to win a lottery) even if he has say 51% power. If we carefully choose the way to use the hash, it can be very difficult (if not impossible) to control the result of lottery.

Maybe we can even chain the blocks by using the hash as another block's index to make it more difficult but I'm not sure whether this will break the randomness.

The down side is that every node (or at least some nodes) needs to download 2 chains to verify the block. But considering the mining power on bitcoin, I think it's worth to directly use bitcoin chain.
« Last Edit: April 02, 2014, 06:04:49 PM by zhangweis »
BTC:15hCQrFMpSxcTSDVYgchajEqGF15XqW1M9
Weibo:http://weibo.com/zhangweis

Offline her0

  • Sr. Member
  • ****
  • Posts: 258
    • View Profile
Re: Lotto two layers design
« Reply #9 on: April 08, 2014, 06:53:48 AM »
再不搞出来chancecoin都把创意拿走了。

 

Google+