diff --git a/README.md b/README.md
index 641aea5..7317baf 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,8 @@
https://arnaucube.com/blog
## Usage
+- Install [blogo](https://github.com/arnaucube/blogo)
- Edit the files from `/blogo-input`
-- Execute `./blogo` to generate the html files
+- Execute `blogo` to generate the html files
More details: https://github.com/arnaucube/blogo
diff --git a/blogo b/blogo
deleted file mode 100755
index 894c430..0000000
Binary files a/blogo and /dev/null differ
diff --git a/blogo-input/blogo.json b/blogo-input/blogo.json
index 56a4e87..6ee1fc7 100755
--- a/blogo-input/blogo.json
+++ b/blogo-input/blogo.json
@@ -8,6 +8,11 @@
"metadescr": "arnaucube blog",
"metaimg": "img/logoArnauCube.png",
"posts": [
+ {
+ "thumb": "shamir-secret-sharing_thumb.md",
+ "md": "shamir-secret-sharing.md",
+ "metadescr": ""
+ },
{
"thumb": "kzg-batch-proof_thumb.md",
"md": "kzg-batch-proof.md",
diff --git a/blogo-input/img/posts/shamir-secret-sharing/degree2.png b/blogo-input/img/posts/shamir-secret-sharing/degree2.png
new file mode 100644
index 0000000..b6a9eee
Binary files /dev/null and b/blogo-input/img/posts/shamir-secret-sharing/degree2.png differ
diff --git a/blogo-input/img/posts/shamir-secret-sharing/line.png b/blogo-input/img/posts/shamir-secret-sharing/line.png
new file mode 100644
index 0000000..58b2e1a
Binary files /dev/null and b/blogo-input/img/posts/shamir-secret-sharing/line.png differ
diff --git a/blogo-input/index.html b/blogo-input/index.html
index 55f207a..4c4df3f 100644
--- a/blogo-input/index.html
+++ b/blogo-input/index.html
@@ -127,6 +127,22 @@
console.log(theme);
}
+
diff --git a/blogo-input/js/external-links.js b/blogo-input/js/external-links.js
index 35753b0..e8c86ad 100644
--- a/blogo-input/js/external-links.js
+++ b/blogo-input/js/external-links.js
@@ -27,6 +27,10 @@ ready(function() {
for (var i = 0; i < anchorElsLength; i++) {
var anchorEl = anchorEls[i];
var href = anchorEl.getAttribute('href');
+ if (href[0]=="#") {
+ // if its an internal link, do not add the 'target=_blank'
+ continue;
+ }
if (!internalLinkRegex.test(href)) {
anchorEl.setAttribute('target', '_blank');
diff --git a/blogo-input/posts/kzg-batch-proof.md b/blogo-input/posts/kzg-batch-proof.md
index d7d66b7..d0620d4 100644
--- a/blogo-input/posts/kzg-batch-proof.md
+++ b/blogo-input/posts/kzg-batch-proof.md
@@ -12,7 +12,7 @@ Let $(z_0, y_0), (z_1, y_1), ..., (z_k, y_k)$ be the points that we want to proo
The *commitment* to the polynomial stands the same than for single proofs: $c=[p(\tau)]_1$.
For the evaluation proof, while in the single proofs we compute $q(x) = \frac{p(x)-y}{x-z}$, we will replace $y$ and $x-z$ by the following two polynomials.
-The constant $y$ is replaced by a polynomial that has roots at all the points that we want to prove. This is achieved by computing the [Lagrange interpolation](https://en.wikipedia.org/wiki/Lagrange_polynomial) for the given set of points:
+The constant $y$ is replaced by a polynomial that has roots at all the points that we want to prove. This is achieved by computing the [Lagrange interpolation](/blog/shamir-secret-sharing.html#lagrange-polynomial%20interpolation) for the given set of points:
$$
I(x) = \sum_{j=0}^k y_j l_j(x)\newline
diff --git a/blogo-input/posts/kzg-commitments.md b/blogo-input/posts/kzg-commitments.md
index 638f12d..7b610a2 100644
--- a/blogo-input/posts/kzg-commitments.md
+++ b/blogo-input/posts/kzg-commitments.md
@@ -81,3 +81,6 @@ We can see that is the equation $q(x)(x-z)=p(x)-y$, which can be expressed as $q
The content covered in this notes is just a quick overview, but allows us to see the potential of the scheme. One next iteration from what we've seen is the approach to do batch proofs, which allows us to evaluate at multiple points with a single evaluation proof. This scheme can be used as a *vector commitment*, using a polynomial where the $p(i) = x_i$ for all values of $x_i$ of the vector, which can be obtained from the $x_i$ values and computing the [Lagrange interpolation](https://en.wikipedia.org/wiki/Lagrange_polynomial). This is quite useful combined with the mentioned batch proofs. The *batch proofs* logic can be found at the [blog/kzg-batch-proof](https://arnaucube.com/blog/kzg-batch-proof.html) notes (kind of the continuation of the current notes).
As a final note, in order to try to digest the notes, I've did a *toy implementation* of this scheme at https://github.com/arnaucube/kzg-commitments-study. It's quite simple, but contains the logic overviewed in this notes.
+
+
+- [Part 2: Batch proof in KZG Commitments](https://arnaucube.com/blog/kzg-batch-proof.html)
diff --git a/blogo-input/posts/kzg-commitments_thumb.md b/blogo-input/posts/kzg-commitments_thumb.md
index 7e47b07..063c072 100644
--- a/blogo-input/posts/kzg-commitments_thumb.md
+++ b/blogo-input/posts/kzg-commitments_thumb.md
@@ -2,4 +2,3 @@
In the following notes I've tried to summarize the KZG Commitments scheme with the concepts that helped me to follow the reasoning.
*2021-08-05*
-
diff --git a/blogo-input/posts/shamir-secret-sharing.md b/blogo-input/posts/shamir-secret-sharing.md
new file mode 100644
index 0000000..8699b58
--- /dev/null
+++ b/blogo-input/posts/shamir-secret-sharing.md
@@ -0,0 +1,89 @@
+## Lagrange Polynomial Interpolation and Shamir secret sharing
+*2021-10-10*
+
+> If you read this post, be aware that I’m not a mathematician, I’m just an amateur on math studying in my free time, and this article is just an attempt to try to sort the notes that I took while learning about Lagrange polynomial interpolation and Shamir's secret sharing.
+
+Imagine that you have a *secret* (for example a *private key* that can decrypt a file), and you want to backup that *secret*. You can split the *secret* and give each slice to a different person, so when you need to reconstruct the *secret* you just need to put together all the parts. But, what happens if one of the parts gets corrupted, or is lost? The secret would not be recoverable.
+A better solution can be done if we use *Shamir Secret Sharing*, which allows us to split the *secret* in $k$ different parts, and set a minimum threshold $n$, which defines the number of required parts to recover the *secret*, so just by putting together any $n$ parts we will recover the original secret.
+
+This has interesting applications, such as social recovery of keys or distributing a secret and ensuring that cooperation is needed in order to recover it. In the following lines we will overview the concepts behind this scheme.
+
+### Lagrange polynomial interpolation
+Lagrange interpolation is also used in many schemes that work with polynomials, for example in [KZG Commitments](https://arnaucube.com/blog/kzg-batch-proof.html) (an actual implementation [can be found here](https://github.com/arnaucube/kzg-commitments-study/blob/master/arithmetic.go#L272)).
+
+The main idea behind is the following: for any $n$ distinct points over $\mathbb{R}^2$, there is a unique polynomial $p(x) \in \mathbb{R[x]}$ of degree $n-1$ which goes through all of them.
+From the 'other side' point of view, this means that if we have a polynomial of degree $n-1$, we can take $n$ points (or more) from it, and we will be able to recover the original polynomial from those $n$ points.
+
+We can see this starting with a line. If we are given any two points $P_0=(x_0, y_0)$ and $P_1=(x_1, y_1)$ from that line, we are able to recover the original line.
+
+
Overview of Langrange Polynomial interpolation and Shamir’s secret sharing.
+ +2021-10-10
+ +The benefit of batch proof is that allows us to proof multiple points while the proof size remains constant to one $\mathbb{G}_1$ point.
@@ -181,6 +190,22 @@ console.log(theme); } + diff --git a/public/js/external-links.js b/public/js/external-links.js index 35753b0..e8c86ad 100644 --- a/public/js/external-links.js +++ b/public/js/external-links.js @@ -27,6 +27,10 @@ ready(function() { for (var i = 0; i < anchorElsLength; i++) { var anchorEl = anchorEls[i]; var href = anchorEl.getAttribute('href'); + if (href[0]=="#") { + // if its an internal link, do not add the 'target=_blank' + continue; + } if (!internalLinkRegex.test(href)) { anchorEl.setAttribute('target', '_blank'); diff --git a/public/kzg-batch-proof.html b/public/kzg-batch-proof.html index 9903d8e..4b9d2e9 100644 --- a/public/kzg-batch-proof.html +++ b/public/kzg-batch-proof.html @@ -72,7 +72,7 @@ Let $(z_0, y_0), (z_1, y_1), …, (z_k, y_k)$ be the points that we want to The commitment to the polynomial stands the same than for single proofs: $c=[p(\tau)]_1$.For the evaluation proof, while in the single proofs we compute $q(x) = \frac{p(x)-y}{x-z}$, we will replace $y$ and $x-z$ by the following two polynomials. -The constant $y$ is replaced by a polynomial that has roots at all the points that we want to prove. This is achieved by computing the Lagrange interpolation for the given set of points:
+The constant $y$ is replaced by a polynomial that has roots at all the points that we want to prove. This is achieved by computing the Lagrange interpolation for the given set of points:$$ I(x) = \sum_{j=0}^k y_j l_j(x)\newline @@ -188,6 +188,22 @@ The problem with Merkle Trees is that the proof size grows linearly with the siz console.log(theme); } + diff --git a/public/kzg-commitments.html b/public/kzg-commitments.html index 169d34d..0ac8dc6 100644 --- a/public/kzg-commitments.html +++ b/public/kzg-commitments.html @@ -147,6 +147,9 @@ $$
As a final note, in order to try to digest the notes, I’ve did a toy implementation of this scheme at https://github.com/arnaucube/kzg-commitments-study. It’s quite simple, but contains the logic overviewed in this notes.
+ +