Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Ethereum signatures conform to the standard defined by the Geth `eth_sign` JSON-RPC call Usage information: $ mmgen-msg --help Testing: $ test/unit_tests.py -v msg.eth $ test/test.py -e --coin=eth --daemon-id=geth -X msgverify_export ethdev
- Loading branch information
Showing
7 changed files
with
182 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env python3 | ||
# | ||
# mmgen = Multi-Mode GENerator, a command-line cryptocurrency wallet | ||
# Copyright (C)2013-2022 The MMGen Project <mmgen@tuta.io> | ||
# Licensed under the GNU General Public License, Version 3: | ||
# https://www.gnu.org/licenses | ||
# Public project repositories: | ||
# https://github.com/mmgen/mmgen | ||
# https://gitlab.com/mmgen/mmgen | ||
|
||
""" | ||
base_proto.ethereum.msg: Ethereum base protocol message signing classes | ||
""" | ||
|
||
from ...msg import coin_msg | ||
|
||
class coin_msg(coin_msg): | ||
|
||
class base(coin_msg.base): pass | ||
|
||
class new(base,coin_msg.new): pass | ||
|
||
class completed(base,coin_msg.completed): pass | ||
|
||
class unsigned(completed,coin_msg.unsigned): | ||
|
||
async def do_sign(self,wif,message): | ||
from .misc import ec_sign_message_with_privkey | ||
return ec_sign_message_with_privkey( message, bytes.fromhex(wif) ) | ||
|
||
class signed(completed,coin_msg.signed): pass | ||
|
||
class signed_online(signed,coin_msg.signed_online): | ||
|
||
async def do_verify(self,addr,sig,message): | ||
from ...tool.coin import tool_cmd | ||
from .misc import ec_recover_pubkey | ||
return tool_cmd(proto=self.proto).pubhex2addr(ec_recover_pubkey( message, sig )) == addr | ||
|
||
class exported_sigs(coin_msg.exported_sigs,signed_online): pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
13.1.dev25 | ||
13.1.dev26 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters