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

Reply to this note

Please Login to reply.

Discussion

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!