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$.


$P$ chooses a random $r$ and calculates the commit $C = rG + [age]H$.
$P$ signs $a$ with $r$ as private key
$P \leftarrow T: C,a, signature_a$
$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.
$T \rightarrow P: signature_c$
$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


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


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


$P$ chooses a random $r$ and calculates $C=g^r h^{[age]}$.
$P$ signs $a$ with $r$ as private key.
$P \rightarrow T: C,a, signature_a$
$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.
$T \rightarrow P: signature_C$
$P \rightarrow V: C, signature_C, proof$