jafalter / bulletproof-js

13 stars 1 forks source link

Is the fiat-shamir transformation not calculating the appropriate points? #14

Open azuchi opened 1 year ago

azuchi commented 1 year ago

The following code in Transcript is only for the first value of the points:

https://github.com/jafalter/bulletproof-js/blob/master/src/Transcript.js#L35

toString() {
    if( this.points.length === 0 ) {
        throw new Error("Can't serialize empty transcript");
    }
    else {
        let str = "";
        for(let i = 0; i < this.points.length; i++ ) {
            str += this.points[0].encode('hex');
        }
        return str;
    }
}

Shouldn't this be all points as follows?

str += this.points[i].encode('hex');

For example, the calculation of the challenge y needs to be derived from the vector pedersen commitment A and S, but in the current implementation it is derived from the concatenated value of the two A value.

jafalter commented 1 year ago

Hi. I haven't worked on this project for some time. So, I would need some time to understand my original code. There may be some bugs as this was just a proof-of-concept implementation. Feel free to fork the code and do the changes you think are necessary.