Skip to main content

Sign & Submit score

Connect to wallet

Connect to the wallet by clicking the "Connect to wallet" button:

Docusaurus with Keytar

Then select the user account. If you don't have a dedicated user account, go to the Presentation page.

Once connected, the account address and a unique game session id are displayed:

Docusaurus with Keytar

If the Thanos wallet is not installed (as a browser extension), then the "Install Thanos" button is displayed.

Sign score

Click the "Compute & sign score" button.

The Orcale recieves the list played actions (direction keys) and the session id.

On the Oracle side, the session id is associated to the initial board configuration. With the list of actions, the oracle is able to compute the score, sign it with its private key and send it back to the DApp's user interface.

When received, the signed score value and actions is displayed abve the "Submit" button:

Docusaurus with Keytar

Submit score

Click the submit button to send it to the smart contract. The transaction information pops up:

Docusaurus with Keytar
[{
"kind":"transaction"
"to":"KT1WXMx4kQmDpPTCFEqgtthRuQR6udy7965k"
"amount":0
"mutez":true
"parameter":{
"entrypoint":"submit"
"value":{
"prim":"Pair"
"args":[{
"bytes":"0507070a000000160000c4ae0cdc2736e665..."
}{
"string":"edsigtn1sDfLLjeifhqWoGLyQmkpoLN9Fmf4..."
}]
}
}
}]

Note that 2 arguments are passed to the submit entry point:

  1. encoded data
  2. signed data (by the Oracle)

The smart contract checks that the signed data is the encoded data signed by the Oracle.