Skip to content
On this page

Realistic scenario โ€‹

We provide a realistic scenario where Alice and Bob play tictactoe on the gamePlatform.

The detailed files of the scenario are here:

scenario_alice.py and scenario_bob.py

New channel โ€‹

Alice

Bob do you want to play state channel tictactoe with me here: KT1Je2FTWwVfBLpGQy5Z1ieuUX4G6JKrxDux?

My coordinates:
address: tz1dtXJpDg4e8tYcGE5b7dzStfvHGyVZivaY
public key: edpkuTgJuK2tK5pixWA27bMZ3JHybicPr6Uy6ang9GWbGvFV4eAPXb

Bob

Ok, let's open a channel with 10 minutes withdraw_delay.

My coordinates:
address: tz1bQx5gL9WLBsc9qyxKj7wGiit78A7frBmK
public key: edpkv3regPfkqjzWuD29P4tq1zkKokRQnGGpg5UMMvvXnCkXNoRqY2

Bob creates the channel
Alice push 50 bonds
Bob push 100 bonds

New game โ€‹

Alice

Here are the game constants.
> game_nonce = game2 ; play_delay =ย 86400 ; bonds =ย {1:{0:20},ย 2:{0:20}}
For the settlements: the loser gives 10 bonds to winer, the inactive player gives 15 bonds, and the double signer 20 bonds. Here is my new game signature: edsigu4c7KkA1WYRLBQbbp1wnEvvSF5rJ4gjpokngWdfH83GuWZMR82fFpJbq5DrnBAwJs4HNXpSeFAt3bRLQXKLgHSRAtGJnez

Bob

Ok, here is my new game signature: edsigtkNn61ApSHkvu4ohsTbz7NaU8YsxKUvFQ5pXJG4pnsmvqaEajZCWW3yannqVAidyNmVxQA38jXXt8jnEgTeGhgez36RjNi

Move 0 โ€‹

Alice

I Play:

| | | |
-------
| |x| |
-------
| | | |

My signature: edsigtzzuykcoPZgjPVZctt1gvQgcwFXzV1mahuCkhYPBZG8LkWknjKLvQsWhwWmZ3ynym8Wj7oTM4bxyEWqTAC1puR5kAcAP4z

Move 1 โ€‹

Bob

Countersignature of move 0: edsigtq9wEwUsNeo1qpXaPAohn6VTHnVMEcEDKJuQ8PaVvjamnVU7ZUEAT4LrYLpLeiQLaQXTM1yWFhsVEkeouJAmkRYaY48PJY
I Play:

|O| | |
-------
| |x| |
-------
| | | |

My signature: edsigtj3hwEz2h3LrnvK9Vv4N7h7BkSbg8LDBFyo99o7UgcBER3PiZcdkUAJXduKCU7eboVakUFY1ZD49E3Fy8yBpxit4srDHQY

...

Game ending โ€‹

Alice push last state onchain
Alice settle the game onchain

The detailed files of the scenario are here:

scenario_alice.py and scenario_bob.py