If hash has been leaked ain't it possible to guessing random secrete key
If you have so much power, to break SHA-256, then you can also break secp256k1, and access the funds of someone else's directly.
I was trying to built a marketplace for this types of Deal
Just to be clear: hashed values should be as random, as private keys are.
This is what can be guessed:
SHA-256("something")=3fc9b689459d738f8c88a3a48aa9e33542016b7a4052e001aaa536fca74813cbBut this one will be hard to guess:
SHA-256(02601ABB20535BA767E7B045483CEDAA9A638637837BCCC1503CA0896556E97BA7)=6b12a0a4a0d6fb7a1d3a7de3cb6d762f6f6d88401ff8092c68387b2ef2524211
And then, of course you can try to go from 0x6b12a0a4a0d6fb7a1d3a7de3cb6d762f6f6d88401ff8092c68387b2ef2524211 into 02601ABB20535BA767E7B045483CEDAA9A638637837BCCC1503CA0896556E97BA7. However, in that case, you could just instead find the private key to 02601ABB20535BA767E7B045483CEDAA9A638637837BCCC1503CA0896556E97BA7, and sweep someone's coins directly.
Then, if the message used for hashing is generated in a similar way, as private keys are, and is never revealed anywhere, then it can be safely used.
And also, revealing the hashed message can be used, to trigger a different transaction. For example:
RIPEMD-160(6b12a0a4a0d6fb7a1d3a7de3cb6d762f6f6d88401ff8092c68387b2ef2524211)=d4f16b29542a9196a2325f9a2ebd34718b98e2cc
p2wpkh(d4f16b29542a9196a2325f9a2ebd34718b98e2cc)=bc1q6nckk22592gedg3jt7dza0f5wx9e3ckvfvaq5r
Then, if anyone will move coins from bc1q6nckk22592gedg3jt7dza0f5wx9e3ckvfvaq5r, it will reveal 02601ABB20535BA767E7B045483CEDAA9A638637837BCCC1503CA0896556E97BA7, which means it will be possible to get 0x6b12a0a4a0d6fb7a1d3a7de3cb6d762f6f6d88401ff8092c68387b2ef2524211 from there, and unlock some HTLC somewhere else.