Yeah. I can see that now. However, from what I can gather now, EC_KEY wants a secret not a private key. So if you pass 'BB7529C7834A210374035F50E884C6CA1E42C6DFB43004463AE3BC38A2585E19' as a paremeter, it's not going to work. How would I go about signing messages with that specific private key?.
sign_message_with_wif_privkey also requires the secret.
So let's say I generate a key through bitaddress.org which gives me WIF format, hex format and all that, how would I go about using that?.
In other side of spectrum, how would I generate a private key & its secret through electrum's source code?. All I can see is mnemonic.py which can create a seed through its make_seed method (to return a set of words) and mnemonic_to_seed which gives me a hex that looks like this:
b'\x1f\x8f\x85S\xe4\x8a\x12mL\xd5&\xe6\x11Z\xdfYAm$-kq|w\xd9\xa1\x00\xd6).L\x95\xc1q\xe6\x1b\x80\xa4w\x19\x1ah\x00[{\xab\x9f\xfe\x8b$\xcc\'a\x99;"Y\xcee(Bx\xa7p' which turns into: b'f7c4fb817c11f2e8e4a93e646168cbbf6fb74648f765b529da2d892a9eb22cbf9dde6e3810f1f28 05d5c522db262f6b3e750beb6f1e4a8bd9f6138ec324d5cfe'
However, regardless of what I pass to EC_KEY, when trying to sign it fails with:
Traceback (most recent call last):
File "test.py", line 24, in <module>
print(key.sign_message('Testing', False))
File "...\src\bitcoin.py", line 739, in sign_message
signature = self.sign(Hash(msg_magic(message)))
File "...\src\bitcoin.py", line 731, in sign
private_key = MySigningKey.from_secret_exponent(self.secret, curve = SECP256k1)
File "...\Python35\lib\site-packages\ecdsa\keys.py", line 137, in from_secret_exponent
assert 1 <= secexp < n
AssertionError