Oddbean new post about | logout
 from monero.backends.jsonrpc import JSONRPCDaemon
from monero.transaction import Transaction

# Connect to your Monero node's JSON-RPC server
daemon_rpc_host = "127.0.0.1"
daemon_rpc_port = "18081"
rpc_user = "your_rpc_username"
rpc_password = "your_rpc_password"

daemon = JSONRPCDaemon(host=daemon_rpc_host, port=daemon_rpc_port, user=rpc_user, password=rpc_password)

def verify_monero_supply():
    try:
        # Step 1: Verify total mined supply based on the emission schedule
        total_mined = 0.0
        last_block_height = daemon.info().height - 1

        for block_height in range(1, last_block_height + 1):
            block = daemon.get_block_by_height(block_height)
            # Verify block reward aligns with the expected reward
            total_mined += block.reward

        # Step 2: Verify cryptographic proofs in each transaction
        for block_height in range(1, last_block_height + 1):
            block = daemon.get_block_by_height(block_height)
            for txid in block.tx_hashes:
                tx = daemon.get_transaction(txid)
                transaction = Transaction(tx)
                # Verify Pedersen Commitments
                if not transaction.verify_pedersen_commitments():
                    print(f"Failed Pedersen commitment verification in transaction {txid}")
                    return
                # Verify Bulletproofs (range proofs)
                if not transaction.verify_bulletproofs():
                    print(f"Failed Bulletproof verification in transaction {txid}")
                    return
                # Verify Ring Signatures
                if not transaction.verify_ring_signatures():
                    print(f"Failed Ring Signature verification in transaction {txid}")
                    return

        print(f"Total Monero Mined: {total_mined:.12f} XMR")
        print("All cryptographic proofs verified successfully. No inflation detected.")

    except Exception as e:
        print(f"An error occurred during verification: {e}")

if __name__ == "__main__":
    verify_monero_supply()



There you go.  The problem is it relies on complex cryptography to accomplish this, which is one of the criticisms of Monero.  For more details study the library's implementation of 
verify_pedersen_commitments
verify_bulletproofs
verify_ring_signatures

As far as pedersen being well understood... by whom, by you?  I don't think so. 
 "On the other hand, we need computers, and the method will convince only those that trust both math and the computer they use."


https://crypto.stackexchange.com/questions/64437/what-is-a-pedersen-commitment#64443


Not a cryptographer, but the math behind is not so difficult. But as the commentor of the link wrote. There is trust involved in math and in the machine you use.

I'd suggest you to talk ti some of the cryptographers you'll find in the Monero community.

For some use cases it is not acceptable to trust, in that cases Bitcoin is preferable over Monero. For other use cases the trust is acceptable.

Most Monero supporters also have been early Bitcoiners. Therefore hold huge bags of both coins. Would I ever consider to spend Bitcoin without going through Monero first? No, because I don't know the future and how the future dictators will treat my financial past. Do I treat Bitcoin as a store of value. Yes.

By the way. Monero is a rather stable coin, like you'd expect from a currency.