These are chat archives for Nethereum/Nethereum

Mar 2018
Mar 16 2018 04:21

Hi - I am trying to sign a transaction off chain and compare it with keccak256 on my smart contract, however it seems that I am getting two different results...


keccak256(bytes4, address, address, address, uint, uint, uint);

.NET, I've used sha3keccak, output results in a totally different hash

CalculateHashFromHex(funcEncoder.ToString, address.PadLeft(40, "0"), address2.PadLeft(40, "0"), address3.PadLeft(40, "0"), number.ToString.PadLeft(64, "0"), number2.ToString.PadLeft(64, "0"), number3.ToString.PadLeft(64, "0"))

I have also tried concatenating the strings together then calculating its hash, or converting them from HexToByteArray then using ByteUtil.Merge. All these results in the same hash on .NET side, but still different compared to the hash result I get from Solidity...

Gut feeling tells me it is something obvious I have overlooked, spent the past 24 hours without much results... Perhaps someone can knock some sense into me please?

Vitaliy Lukanin
Mar 16 2018 18:26
I have a task to create contract creation transaction (not signed) by client request and send it to client for sign (not dotnet side). After that I will receive signed transaction back, validate that it is not changed and execute it. What is a good way to implement such workflow with NEthereum? I reviewed Github sources but couldn't find appropriate logic or examples that could be used..