From 2a5bd3a28c3ea6813fb90cbf24c2aebc7c4ea473 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Tue, 23 Jul 2024 21:45:39 +0200 Subject: [PATCH] Use cut to strip the 0x prefix --- MANUAL_INSTRUCTIONS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MANUAL_INSTRUCTIONS.md b/MANUAL_INSTRUCTIONS.md index 2988b81..1b84d46 100644 --- a/MANUAL_INSTRUCTIONS.md +++ b/MANUAL_INSTRUCTIONS.md @@ -23,8 +23,8 @@ The following can be done in a Docker container for additional isolation, includ 11. Create a DER form of the Eth key: `echo -n $ETH_KEY_SRC | xxd -r -p -c 118 > eth_key.der` 12. `openssl ec -inform der -in eth_key.der > eth.key` 13. Prepare a message to sign: - - Take your ethereum address _without_ the '0x' prefix. - - `UNSIGNED_MSG="$(echo -n $'\x19Ethereum Signed Message:\n'20 | xxd -p)"` + - Take the destination ethereum address _without_ the '0x' prefix. + - `UNSIGNED_MSG="$(echo -n $'\x19Ethereum Signed Message:\n'20 | xxd -p)$(echo $DESTINATION_ETH_ADDR | cut -c3-)"` - `echo -n "$UNSIGNED_MSG" | xxd -r -p | ~/.cargo/bin/sha3sum -a Keccak256` to get your signed message hash. The first part of this output is your hash, set it as `$HASH`. The short-form of this is (the nbsp separator makes this look odd): `HASH=$(echo -n "$UNSIGNED_MSG" | xxd -r -p | ~/.cargo/bin/sha3sum -a Keccak256 | awk -F $'\xC2\xA0' '{ print $1 }')` 14. With HASH as the hex output of the signed message hash above, `SIGNATURE_HEX=$(echo $HASH | xxd -r -p | openssl pkeyutl -sign -inkey eth.key | xxd -p -c 72)` 15. You now have all elements of your proof, make a CSV form of them: `echo "${USER_ID},${ETH_ADDR},${SIGNATURE_HEX},${MERKLE_PROOF}"`