Pull to refresh

The Waves company has temporarily suspended it’s blog on Habr

Show first

Blockchain RSA-based random

Reading time 5 min
Views 1.8K
There’s a problem we needed to address in the course of developing our games. It’s complicated to generate a random number in a distributed network. Almost all blockchains have already faced this issue. Indeed, in networks where there is no trust between anyone, the creation of a random number solves a wide range of problems.

In this article, we explain how we solved this problem for our games. The first of these was Waves Xmas Tree.



Read more →
Total votes 13: ↑13 and ↓0 +13
Comments 0

Web Worker easier than you thought

Reading time 6 min
Views 3.6K

Web Worker easier than you thought


In this article, a DIRTY, unsafe, unstable and scary <em>eval</em> method will be described. So, if you are uncomfortable with that, stop reading right now.


First off, some issues with convenience remained unresolved: in code sent to web web workers, closure can't be used.




All of us like new technologies, and all of us like new technologies to be convenient to use. However, it's not exactly the case with web workers. web workers accept files or links to files, which isn't convenient. It would be good to be able to put any task into web workers, not just specifically planned code.


What do we need to make web workers more convenient to operate? I believe, it's the following:


  • A possibility to launch in web workers any code at any moment
  • A possibility to send to web workers complicated data (class instances, functions)
  • A possibility to receive a promise with a reply from a web worker.
Read more →
Total votes 6: ↑6 and ↓0 +6
Comments 0

How to Catch a Cat with TLA+

Reading time 3 min
Views 1.8K
Many programmers struggle when using formal methods to solve problems within their programs, as those methods, while effective, can be unreasonably complex. To understand why this happens, let’s use the model checking method to solve a relatively easy puzzle:

Conditions


You’re in a hallway with seven doors on one side leading to seven rooms. A cat is hiding in one of these rooms. Your task is to catch the cat. Opening a door takes one step. If you guess the correct door, you catch the cat. If you do not guess the correct door, the cat runs to the next room.
Read more →
Total votes 9: ↑9 and ↓0 +9
Comments 0

Riding the Web 3.0 wave

Reading time 6 min
Views 1.9K
Developer Christophe Verdot shares his experiences of recently taking the online course ‘Mastering Web 3.0 with Waves’.



What is your background? What motivated you to take the course?

I’ve been a web developer for about 15 years, working mostly as a freelancer.
Read more →
Total votes 11: ↑8 and ↓3 +5
Comments 0

Protocol for communication between iframe and the main window

Reading time 4 min
Views 4.8K

From time to time, developers need to establish communication between several browser tabs to be able to send messages from one tab to another and receive responses. We have also faced this need at some point.


Some solutions already exist (like, for instance, BroadcastChannel API). However, its browser support leaves a lot to be desired, so we decided to use our own library. When the library was ready, that functionality was no longer required. Nevertheless, another task emerged: communication between an iframe and the main window.


On closer examination, it turned out that two-thirds of the library would not have to be changed — only some code refactoring was necessary. The library is a communication PROTOCOL that can work with text data. It can be applied in all cases in which text is transferred, such as iframes, window.open, worker, browser tabs or WebSocket.


How it works


Currently, the protocol has two functions: sending messages and subscription to events. Any message in the protocol is a data object. For us, the main field in that object is type, which tells us what kind of message it is. The type field is an enum with the following values:

Read more →
Total votes 13: ↑12 and ↓1 +11
Comments 2

«Non-Blockchain Games Involving Money Must Die»

Reading time 4 min
Views 1.7K


Dmitry Pichulin, known under the nick «deemru», won the game Fhloston Paradise, developed by Tradisys on the Waves blockchain.

The winner of Fhloston Paradise was supposed to be the player paying the very last stake during a 60-block period, before any other player could pay their stake and reset the counter to zero. The winner would collect all stakes paid by other players.

Dmitry's winning recipe was the bot Patrollo, which he created. The bot paid just eight 1 WAVES stakes for Dmitry and eventually won him 4,700 WAVES ($13,100). In this interview, Dmitry discusses his bot and prospects of blockchain games.

Read more →
Total votes 21: ↑17 and ↓4 +13
Comments 0