Skip to content

Instantly share code, notes, and snippets.

@j-berman
j-berman / xmr_pedersen_simplified.py
Last active December 3, 2022 19:04
How pedersen commitments are constructed to hide amounts in Monero's RingCT (simplified)
# The goal with this program is to demonstrate how to construct pedersen
# commitments in similar fashion to how the Monero tx protocol does, but in a hugely
# simplified way (read: not exact, but close), to show how we can prove hidden input
# and output amounts balance.
# Some stuff is left as an exercise to the reader where commented.
# **Corrections are very much so welcome.**
# I encourage anyone who doesn't know much about pedersen commitments to
# go through coinstudent2048's excellent tutorial on elliptic curve
# cryptography [1] first. And anyone interested in this to first read through
# Zero to Monero v2 chapters 5 and 6 [3].