Author Topic: Bitshares Play two layers design  (Read 4462 times)

0 Members and 1 Guest are viewing this topic.

Offline her0

  • Sr. Member
  • ****
  • Posts: 258
    • View Profile
再不搞出来chancecoin都把创意拿走了。

Offline zhangweis

  • Sr. Member
  • ****
  • Posts: 305
    • View Profile
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 »
Weibo:http://weibo.com/zhangweis

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi

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 HackFisher

  • Moderator
  • Hero Member
  • *****
  • Posts: 883
    • View Profile

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

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi

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
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 HackFisher

  • Moderator
  • Hero Member
  • *****
  • Posts: 883
    • View Profile
+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 ssjpts

  • Hero Member
  • *****
  • Posts: 538
    • View Profile
    • 中国BTC
  • BitShares: coolman
 +5%如果附上中文版的会不会更好?
新浪微博:剑指未来BTS
BTC:1Bc7gRGotktBmnNFr3BUUM22HFXCCTyxor
BTSX ID:loves,集大众之爱,待到BTS 500刀,10%回退给捐赠者,10%用于运营,剩余80%用于爱心事业和BTS宣传推广。

bitbro

  • Guest
Would this help as foundation for BitShares Lotto family DACs such as BitShares Vegas?


Sent from my iPhone using Tapatalk

Offline HackFisher

  • Moderator
  • Hero Member
  • *****
  • Posts: 883
    • View Profile
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.