# Generating ElGamal parameters in a mix net

I am reading this paper regarding re-encryption mix nets. I want to implement my own for educational purposes and I am stuck at the initial steps of how I should generate the keys and distribute them. The paper for this step says that

"Key generation: all decryption servers jointly generate the parameters (q, g, x, y) of an ElGamal cryptosystem in a group G of order q generated by g, using for example the threshold key generation protocol of Pedersen "

This whole step though seems to be more complex than I initially thought and I have failed to find any other implementations out there to study from. Can someone explain in simple steps the process of how the mix servers jointly generate the public and private parameters of an ElGamal cryptosystem?

1. Every participant $P_i$ (for $i=0\ldots n$) picks a secret key $sk_i$ and computes the public key part $pk_i = g^{sk_i}$. $P_i$ then publishes a commitment to $pk_i$.
2. When all commitments have been broadcast all the $pk_i$ are revealed and the commitments checked.
3. The global public key is $pk = \prod_{i=1}^n pk_i$