Stealth Payments - Sample Code / Proof of Concept



Summary:

On January 13, 2014, Mike Hearn and Jeremy Spilman were discussing a transaction on the Bitcoin TestNet. Spilman had spent 1BTC to a stealth address which Hearn asked if it could be redeemed. Spilman created a separate test with hard-coded values from the block chain to create a redeeming Tx that was sent successfully using sendrawtransaction. Spilman was self-mining since no one else seemed to be on TestNet at the time.Spilman's code for generating the transaction is available on Github, and he confirmed that he used a private C# bitcoin implementation for it. There is nothing particularly special about the libraries under the hood, just standard Bitcoin/EC/BIP32 stuff using OpenSSL instead of BouncyCastle.The two discussed whether or not the 0BTC OP_RETURN transactions should be hidden from the Transaction List and decided to show "Payment received from Jeremy, 0.1 BTC" instead. They also agreed that "Merchant" might not be the best name for the address column and suggested changing it to "Recipient. "Hearn suggested extending the wallet format to keep 'd2'/'Q2' unencrypted so that they are available for doing necessary tests but have no chance of ever being used as a stand-alone private key. He also expressed concern about people being able to detect such payments by testing if decrypted values are points on the curve, but was unsure how the risk worked.Finally, Spilman's stealth redemption Tx went through, and he signed off for the night.


Updated on: 2023-06-08T00:00:37.358379+00:00