Development

GitHub metrics

Developer activity (from Coinlib.io)

In the previous report we wrote that Wanchain Proof of Stake was one step closer to launch, and the developer team was happy to announce Alpha testing were going to live in May, over a month ahead of schedule!” And now we are pleased to inform you that Wanchain Proof of Stake Alpha Testnet is Live.

There is news that Wanchain’s Proof of Stake mechanism has completed the rigorous internal testing and is ready for Alpha testing! The development team invites blockchain developers to stress test the system and report bugs for a bounty reward from a pool of 50,000 WAN. Bounties will be rewarded based on the severity of the bug (high, medium low). They invite everybody to sign up for Alpha testing.

If you are interested in Aplha Testing, you are able to get started via this manual on Github. Furthermore, if you find any bugs, please submit them to bounty@wanchain.org.

More details about economy model you can find out here.

Proof of Stake Explorer

If interested, you can check the current status of validator nodes through the alpha PoS explorer page.

New tutorials:

Wanchain Galaxy Consensus Proof of Stake Technical Deep Dive: Pt. 3

In the previous technical deep dive articles Wanchain introduced its Galaxy Consensus in Part 1, and the developers discussed its random beacon design in Part 2. In this article, the team will be taking a closer look at leader selection algorithms, and at Galaxy Consensus’s Unique Leader Selection (ULS) algorithm.

As described in Part 1, in the process of consensus, the nodes will form two large groups — the RNP (Random Number Proposer) group and the EL (Epoch Leader) group. The former is responsible for the generation of random numbers, while the latter is responsible for block production. One of the key problems for any consensus protocol is determining which individual node will be the block producer. This article will explore how the block producer is chosen from within the EL group (leader selection).

Let us briefly tell you about this article.

The main subject of the article is Galaxy ULS (Unique Leader Selection) algorithm. The Wanchain Galaxy Consensus’s leader selection algorithm termed ULS, or Unique Leader Selection algorithm. It was designed from the ground up to consider fairness, verifiability and anonymity, and employs a variety of cryptographic methods such as secret sharing and zero-knowledge proofs to realize the anonymous selection of a single unique valid block producer in a fixed time window. The algorithm was also designed to reduce the probability of forks and improve the efficiency of consensus. Below we will introduce the overall principle of the Galaxy Consensus’s ULS algorithm published by Wanchain.

1. EL group selection

Epoch Leader Selection

The EL (Epoch Leader) group is the main body for running the ULS algorithm. Let’s start with the source of the EL group. In a PoS protocol, the right to speak is determined by the amount of stake held, and Wanchain implements this in the selection process of the EL group. Based on the current stake in the Wanchain consensus smart contract, the stake value of each node and its stake ratio can be calculated. Using the random number provided by the Random Beacon, the follow-the-stake-ratio algorithm is run, similar to the follow-the-satoshi process. Each node is assigned a certain breadth of time proportional to its stake, and then the random number is used to decide a specific time. Whomever’s breadth of time in which the time is chosen, the owner of that breadth of time is then selected to be in the EL group. Each round is an independent selection, meaning that a node may be selected multiple times, so the final EL group is a multiset (nodes may be chosen more than once within one EL group). The selected EL group will then be responsible for running the ULS algorithm.

2. Secret Message Array generation

After the EL group is selected, it needs to communicate on chain. The process is to generate a secret message sequence inside the group for subsequent assignment of block production rights, which is a key step for us to achieve anonymity. In order to ensure that the secret message sequence is not controlled by some malicious nodes, we split the process into two phases, SMA1 and SMA2. In the SMA1 phase, each node in the group selects a random number, encrypts it with its own public key, and sends it to the chain as a commitment (CM) for the random number selection, ensuring that the random number selected by any node cannot be changed in subsequent stages. In the SMA2 phase, each node in the constellation sends its own chosen random number to the chain with the public key of all nodes (including itself), and provides a DLEQ-Proof (discrete log equivalence proof), which is used in the SMA1 phase. The key-encrypted data ensures that the random number has not changed, and the DLEQ proof ensures that all public keys are encrypted with the same random number. After this phase is completed, all EL group nodes can all decrypt the data themselves and get a random data sequence, which is our secret message sequence, and are then ready to run the leader selection algorithm.

3. EL group sorting

After the secret message sequence is generated, the random number is updated, and the newly generated random number is used as a seed to sort the EL group nodes. A hash operation is performed on the group node’s public keys and the random number, and the nodes are sorted in ascending order based on the operation result. This result will be used for the allocation of the order of subsequent block production rights. Obviously, the sorting is based on the new random number after the secret message sequence, and no node can affect it, the sorting is completely random.

4. Slot leader selection

After the above three tasks are completed, the distribution of the block production rights can be performed for the EL group nodes. In the previous article, the Wanchain’s team said that a group of EL nodes is responsible for the generation of blocks within an epoch. How then is the block producer of each slot in the epoch determined? First, the current random number and the epoch number and the slot number are hashed, and the modulus of the number of EL group nodes is used to pick the slot leader. For example, if the hash value is 2019, the number of EL group nodes is 50, the modulus result will be 19, so then the EL node with the number 19 in the order from the previous sorting step is selected as the valid block producer (slot leader). This selection process is carried out with equal probability for all members of the EL group. Combined with the stake rate which is used when the EL group nodes are selected (remember, the EL group is a multiset meaning a single node may appear in it more than once), it ensures that the choice of the block producer is made in accordance with the ratio of stake held by consensus participants. The valid block producer must provide proof of its validity when proposing a block, and this proof must be publicly verifiable in order to guarantee its validity. The secret message array used in the selection of the slot leader is shared only within the EL group, other nodes have no knowledge of it, which guarantees the anonymity of the selection process. It can thus be seen that the ULS algorithm is a design that fully considers fairness, verifiability and anonymity, and will play an important positive role in ensuring the safety and liveness of the chain.

The above is a brief introduction to Galaxy Consensus’s leader selection algorithm — the ULS algorithm. The details are described more fully in the Galaxy Consensus paper.

In the previous two articles, Wanchain introduced two core algorithms of Galaxy Consensus, the random number generation algorithm and the leader selection algorithm. These two algorithms ensure that the consensus process can proceed safely and steadily after. The question still remains, how can we promote the participation of all token holders? This article will detail how Wanchain’s delegation mechanism answers that question.

The theoretical basis of Galaxy Consensus’s delegation mechanism — proxy signatures.

Proxy Signature Algorithm

A proxy signature is a special signature algorithm in cryptography that enables an individual, the Original Signer, to delegate his or her right to sign a message to another individual, the Proxy Signer. The Proxy Signer can calculate a delegate signature, and any individual with the Original Signer’s public key can verify the validity of the signature. Strictly speaking, the proxy signature algorithm is a collection of multiple algorithms,

PS = (G, K, S, V, (D,P), PS, PV)

where G, K, S, V make up a standard digital signature algorithm (such as ECDSA), D, P are algorithms for delegating and accepting delegations, PS is the proxy signature generation algorithm, and PV is the proxy signature verification algorithm.

Galaxy Consensus’s Delegation Mechanism Process

The delegation mechanism of Galaxy Consensus was designed by the Wanchain research team as a universal, secure, and efficient delegation mechanism. The mechanism is based on the Triple ECDSA Proxy Signature algorithm, which, combined with smart contracts, implements a complete delegation mechanism. The mechanism enables any WAN holder to join the Galaxy Consensus, contribute to network security, and gain protocol rewards.

Suppose Alice is a normal WAN holder with public-private key pair (pkᵢ, skᵢ),and Bob is a galaxy consensus proxy node with public-private key pair (pkⱼ, skⱼ). Proxy_SC is a special smart contract used to verify and store data in the delegation process. Alice wants to delegate her rights to Bob to participate in Galaxy Consensus on her behalf. The detailed process is as follows:

Step 1: Alice locally enters her private key skᵢ and Bob’s public key pkⱼ into the triple ECDSA algorithm to generate a delegation certificate:

cert =（pkᵢ,pkⱼ,ω,(R,s)）

Step 2: Alice constructs a transaction, sends the delegation certificate to Proxy_SC, and sends her WAN to be locked in Proxy_SC.

Step 3: Proxy_SC verifies the validity of the proxy certificate issued by Alice, and generates the proxy public key pkp and the delegation certificate to be stored in the contract.

Step 4: Bob parses the certificate stored in Proxy_SC and calculates the proxy private key skp by using its own private key skⱼ.

Step 5: The proxy public key pkp participates in the galaxy consensus as an independent identity, and Bob completes the consensus process by using the proxy private key skp and receives the consensus reward.

Step 6: Consensus rewards are distributed between Alice and Bob according to the specified rate in the smart contract.

Step 7: After the delegation period ends, Proxy_SC will return the entrusted funds to Alice’s account.