Post
Topic
Board Gambling discussion
Re: bustabit.com - New seeding event
by
leomedina
on 03/03/2024, 16:27:06 UTC

You need to use the previous hash. So, if prevGameHash is the hash of game #10002812, you have to validate the signature of game #10002813, and so on. I didn't try to run your code, but you probably want to use hexToBytes instead of Uint8Array(Buffer.from(foo)) where you declare prevGameHash and vxSignature.

Yep, you're right, hexToBytes did the trick, thanks a lot! And a last question (I promise it'll be really last one :-) ) : How could I deduct vxSignature for the next (in the reverse manner) hash/game ? return bls.verify(vxSignature, message, VX_PUBKEY); just gives me back true/false like a validation, whether the current signature is correct (or not).

In any case many thanks again, Leo, for your co-operation, I really appreciate it!

No problem at all! Happy to help. Well, it's Vx that gives us that signature, so you need to communicate with its API. For example, in the same verifier, we call getVxSignature (line 12 in https://stackblitz.com/edit/bustabit-verifier?file=src%2Futils%2Fvx.ts), validate it, and then finally use it to generate the game's result.