Oddbean new post about | logout
 Trying to working on the L402 lightning specification

My understanding is that: sha256(preimage) = payment_hash

What am I doing wrong? I can never get these to match.

#programming #python #asknostr
https://m.primal.net/LTjj.png  
 @NotBiebs do you know what I’m doing wrong here? 
 Try making the hash like this hashlib.sha256(bytes.fromhex(preimage)).hexdigest() 
 It’s cause the preimage is in hex format 
 I knew you were the right guy

Thanks, homie! That worked!