diff --git a/examples/rln-js/index.html b/examples/rln-js/index.html
index 49fda79..ec9206e 100644
--- a/examples/rln-js/index.html
+++ b/examples/rln-js/index.html
@@ -403,7 +403,9 @@
try {
registerButton.disabled = true;
- const pubkey = ethers.BigNumber.from(membershipKey.IDCommitment);
+ const idCommitment = membershipKey.IDCommitment;
+ const reversedArray = idCommitment.slice().reverse();
+ const pubkey = ethers.utils.hexlify(reversedArray).toString();
const price = await rlnContract.MEMBERSHIP_DEPOSIT();