# How to change the following commitment scheme to Pedersen commitment?

In my question here Zero knowledge set membership protocol

The suggested solution allows a prover to choose a commitment $$C$$. Then, A trusted third party ($$T$$) can validate if $$C$$ is valid or not. The $$C$$ is in form of $$C = rG + [age]H$$. How to make a similar protocol with $$C = g^{r}h^{[age]}$$ as in Pedersen commitment scheme where $$g,h$$ are elements in a group $$G$$ of prime order $$q$$

Here is the answer form the previous question: Notation: $$P$$ is the prover, $$T$$ is the trusted party, $$V$$ is the verifier, $$a$$ is the information to convince $$T$$ of $$P$$'s age, $$A \rightarrow B: x$$ means that party $$A$$ send information $$x$$ to party $$B$$.

1. $$P$$ chooses a random $$r$$ and calculates the commit $$C = rG + [age]H$$.
2. $$P$$ signs $$a$$ with $$r$$ as private key
3. $$P \leftarrow T: C,a, signature_a$$
4. $$T$$ looks up $$P$$'s age, calculates $$R=C-[age]H$$, verifies $$signature_a$$ against $$R$$ and sign's $$C$$ using $$T$$'s private key.
5. $$T \rightarrow P: signature_c$$
6. $$P \rightarrow V: C, signature_c, proof$$

My answer one the other question assumed that you use elliptic curves as they usually are more common when it comes to ZKP because of their size and speed, however, you can easily change the notation since

1. $$xG$$ is equivalent to $$g^x\ (mod\ p)$$
2. $$A+B$$ is equivalent to $$A\cdot B\ (mod\ p)$$

I will not explicitly write $$(mod\ p)$$ from now on.

1. $$P$$ chooses a random $$r$$ and calculates $$C=g^r h^{[age]}$$.
2. $$P$$ signs $$a$$ with $$r$$ as private key.
3. $$P \rightarrow T: C,a, signature_a$$
4. $$T$$ looks up $$P$$'s age, calculates $$R = C \cdot h^{-[age]} = g^rh^{[age]}h^{-[age]}=g^r$$, verifies $$signature_a$$ against $$R$$ and signs $$C$$ using $$T$$'s private key.
5. $$T \rightarrow P: signature_C$$
6. $$P \rightarrow V: C, signature_C, proof$$