Skip to content

Generate Signatures with Web3py #1

@davinci26

Description

@davinci26

A code snippet that does not work:

## Signature Testing ###
msg_hash = Web3.sha3(text= 'password')
private_key = b"\xb2\\}\xb3\x1f\xee\xd9\x12''\xbf\t9\xdcv\x9a\x96VK-\xe4\xc4rm\x03[6\xec\xf1\xe5\xb3d"
print(m_web3.eth.account)
attribDict = m_web3.eth.account.signHash(msg_hash, private_key = private_key)
attribDict = m_web3.eth.account.signHash(msg_hash)
msgHash = Web3.toHex(attribDict['messageHash'])
v = attribDict['v']
r =  Web3.toHex(attribDict['r'])
s =  Web3.toHex(attribDict['s'])
print(attribDict)

Need to fix that

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions