Trending Technology Machine Learning, Artificial Intelligent, Block Chain, IoT, DevOps, Data Science

Recent Post

Codecademy Code Foundations

Search This Blog

Modulo Operation in Blockchain

7/5 = 1 remainder 2
  • If you are only are interested in the remainder, the mathematical notation is: 7 mod 5  = 2
  • You pronounce it as: 7 modulo 5 is congruent to 2
  • In this example the value 5 is called the modulus
  • The purpose of applying a modulo operation is to keep the resulting value (remainder) within a certain range.
0 mod 5 = 0
1 mod 5 = 1
2 mod 5 = 2
3 mod 5 = 3
4 mod 5 = 4
5 mod 5 = 0
6 mod 5 = 1
7 mod 5 = 2
8 mod 5 = 3
9 mod 5 = 4 
10 mod 5 = 0
11 mod 5 = 1
12 mod 5 = 2
13 mod 5 = 3
14 mod 5 = 4
  • n mod p = "remainder" = {0.....p-1}
  • Example: λ2 - x - xG (mod p) 
Modulo operation is also called a clock operation.


The purpose of this blog is not to teach you how to do modulo arithmetic but just to explain what the purpose is of a modulo operation.

Example:
  • 𝜆 = (yG - y) / (xG - x) (mod p)
  • xR = 𝜆2 - x -xG (mod p)
  • yR = 𝜆(x - xR) - y (mod p) 

No comments:

Post a Comment

Popular Articles