decred/atomicswap

OP_SHA256

jrick opened this issue · 4 comments

jrick commented

Now that the new OP_SHA256 rules have been activated in Decred, all of the atomic swap tools should switch over to this more secure hash function. They are currently using OP_RIPEMD160 due to the sha256 opcode not having been available in the Decred scripting vm.

Before this can be completed, all of the txscript packages must be updated to recognize the OP_SHA256 version of the atomic swap contract:

@dasource @metalicjames heads up, I'll be creating some PRs for your projects for this change.

TODO: After the required pull requests are merged, it needs dep ensure -update

Hi,
Is it just the one vendor change in txscript/standard.go please?
//gf:future->
// pops[1].opcode.value == OP_SHA256 &&
// pops[2].opcode.value == OP_DATA_32 &&
pops[1].opcode.value == OP_RIPEMD160 &&
pops[2].opcode.value == OP_DATA_20 &&
//<-gf
...

Thanks

jrick commented

The links in the issue description contain the diffs for the vendored changes. In addition to these changes, the atomicswap tools themselves must also be updated to create contract scripts using SHA256-hashed secrets.

@jrick Apologies for the delay, I must've missed the notification for your pull request into vtcd. Merged now.