Home
Writeups Misc About
Toshi's Treasure

Toshi's Treasure

This is about a particular weakness of the Shamir's secret sharing scheme. During the share reassembly process, Shamir's secret sharing does not provide a way to verify the correctness of each share being used. Verifiable secret sharing aims to verify that shareholders are honest and not submitting fake shares.

The basis of Shamir's secret sharing is on Lagrange basis polynomials. My solution is based on the computationally efficient approach of the scheme.

The key to cracking this challenge, is realizing that the Lagrange interpolation is a sum of values yif(x), where f does not depend on any other data points, aside from the participants' x-coordinates. We can set the y coordinate of our share to be 0, which effectively reduce our contribution to zero. The value we obtained after the message of invalid private key should give us back the sum of the contributions from others' shares. We can denote this value by O.

For the reassembled value to be the 1k wallet of hyperreality W, we basically needs to solve for y such that:

O+yf(x)=W

where f(x) is the following (refer to the computationally efficient approach of Shamir's secret sharing):

m=0k1xmxmxj

We know all the x coordinates from the others, which is the set of 2,3,4,5, and ours is 6. Solving for y is just a matter of simple modular arithmetic. After sending the share to lead everyone to the wrong wallet, we can easily obtain the original secret using the same mathematical formula.

Python Implementation: