In this article, we will analyze the answer found on the internet for the question : how to generate a reversible pseudo-random number from a sequence number.

The Question

Every user-facing application will have this existential problem :

  • Users should be able to use a simple ID for each object.
  • Users should not be able to get the internal sequence ID.

The commonly accepted solution is to use an external ID that will be public and an internal ID that will be private, and to use a reversible one-to-one function that can transform the given id into the other one.

id ==…


In this article, we will explore the different ways to implement the pipeline design pattern starting from the basics to more complex solutions.

The Pipeline Pattern

The pipeline pattern is a software design pattern that provides the ability to build and execute a sequence of operations.

Image for post
Image for post
https://www.hojjatk.com/2012/11/chain-of-responsibility-pipeline-design.html

This pattern is better used in conjunction with the plugin pattern, to dynamically build the pipeline when the application starts.

Sequence

The most basic implementation of a pipeline would be a simple sequence of operations.

The interface of an operation can be invoked to process data.

The pipeline processes each operation one by one. The pipeline class is also implementing the IOperation interface so they can be combined. …


In this article, we will see how to create a protocol where events can be extended with new properties, using c# extension methods.

Software Architecture in the real world

When you develop a product that is successful, there will always be a time when you will have requirements for creating another version of the product for another client.

Of course this client will have slightly different requirements for the products, that will have deep implications for the design of the business entities.

In the end of the day, you will have to maintain two different versions of the project, but a good software design can avoid much of the code duplication. …


In this series, we will explore well know design patterns and how to (not) use them when writing high performance software.

In this article we will take a look at the implementation of a concurrent producer/consumer pattern and compare how it interacts with the Memento and Post State patterns.

Application

Let’s take a simple concurrency scenario using the previous implementations of the AccountService.

The producer thread will create 2 accounts, deposit 10000 BTC to the first account and 10000 USD to the second account, then exchange 1 BTC for 1 USD between where the first and the second account, 10000 times. …


In this series, we will explore well know design patterns and how to (not) use them when writing high performance software.

In this article we will take a look at the conceptual definition of the Post State design pattern and write a realistic implementation of the pattern.

The Post State Pattern

The post state pattern is a software design pattern that provides the ability to build the next state of an object without altering its current state.

Image for post
Image for post

This pattern is especially relevant in a multi-threaded environment.

State & Post State

The state contains a collection of immutable accounts that can be read at anytime, but should be atomically updated. …


In this series, we will explore well know design patterns and how to (not) use them when writing high performance software.

In this article we will take a look at the formal definition of the Memento design pattern and write a realistic implementation of the pattern.

The Memento Pattern

The memento pattern is a software design pattern that provides the ability to restore an object to its previous state (undo via rollback).

Image for post
Image for post
https://en.wikipedia.org/wiki/Memento_pattern

This pattern is only relevant when dealing with mutable objects.

Application

Let’s take a simple scenario for using the memento pattern.


Today we are having some fun by creating a simple game using near protocol.

Making things work

For our project, we will use the multiplayer place game from the official tutorial :

Image for post
Image for post

Plot twist: It does not work! We need to change our plan…

Let’s start with something we know is working: the Hello World project!


In September 2016, Ethereum co-founder Vitalik Buterin published a paper titled “Chain Interoperability” to explain the different approaches to blockchain interoperability. He wrote,

From a technical perspective, there are three primary categories of strategies for chain interoperation:

● Centralized or multisig notary schemes, where a party or a group of parties agree to carry out an action on chain B when some event on chain A takes place.

● Sidechains/relays (systems inside of one blockchain that can validate and read events and/or state in other blockchains).

● Hash-locking (setting up operations on chain A and chain B that have the same trigger, usually the revelation of the preimage of a particular hash). …


This article is part of the Under The Hood series, where we will take an in-depth look at blockchain architecture and how blockchains work under the hood.

In this article, we will focus on how merkle trees are implemented by different blockchain protocols and what their features bring to the whole project.

Bitcoin

Image for post
Image for post
https://blog.ethereum.org/2015/11/15/merkling-in-ethereum/

Bitcoin is using a merkle tree to compute the merkle root hash of the transactions included in a block which allows partial integrity verification using merkle proofs.

The merkle tree is finalized and the hash is computed when the block is created. …


The launch of Bitcoin nearly ten years ago ushered in the world’s first decentralized, trustless and democratic economy. It was also the first practical demonstration of blockchain technology, the pioneer of a new era for distributed ledger technology.

Today, there are over 2,000 cryptocurrencies currently in circulation, all based on the same underlying technology. As a result, it has become increasingly clear that no single blockchain can reign supreme over the rest. Since blockchain projects are often designed for highly specific use cases, they tend to each have a unique balance of security, decentralization and convenience. …

About

Guillaume Bonnot

Software & Blockchain Architect, CEO @ Helios Services

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store