ethereum / web3.py

A python interface for interacting with the Ethereum blockchain and ecosystem.
http://web3py.readthedocs.io
MIT License
4.98k stars 1.7k forks source link

Invalid sender issues on bsc network #2760

Closed fantarics closed 1 year ago

fantarics commented 1 year ago
aiohttp==3.8.3
aiosignal==1.3.1
altgraph==0.17.3
async-timeout==4.0.2
attrs==22.1.0
base58==2.1.1
bitarray==2.6.0
certifi==2022.9.24
cffi==1.15.1
charset-normalizer==2.1.1
cytoolz==0.12.0
ed25519==1.5
eth-abi==2.2.0
eth-account==0.5.9
eth-hash==0.5.1
eth-keyfile==0.5.1
eth-keys==0.3.4
eth-rlp==0.2.1
eth-typing==2.3.0
eth-utils==1.9.5
frozenlist==1.3.3
hexbytes==0.3.0
idna==3.4
ipfshttpclient==0.8.0a2
jsonschema==4.17.1
keyboard==0.13.5
lru-dict==1.1.8
macholib==1.16.2
multiaddr==0.0.9
multidict==6.0.2
netaddr==0.8.0
parsimonious==0.8.1
protobuf==3.19.5
pycparser==2.21
pycryptodome==3.16.0
pyinstaller==5.6.2
pyinstaller-hooks-contrib==2022.13
PyNaCl==1.5.0
pyobjc==9.0
pyobjc-core==9.0
pyobjc-framework-Accessibility==9.0
pyobjc-framework-Accounts==9.0
pyobjc-framework-AddressBook==9.0
pyobjc-framework-AdServices==9.0
pyobjc-framework-AdSupport==9.0
pyobjc-framework-AppleScriptKit==9.0
pyobjc-framework-AppleScriptObjC==9.0
pyobjc-framework-ApplicationServices==9.0
pyobjc-framework-AppTrackingTransparency==9.0
pyobjc-framework-AudioVideoBridging==9.0
pyobjc-framework-AuthenticationServices==9.0
pyobjc-framework-AutomaticAssessmentConfiguration==9.0
pyobjc-framework-Automator==9.0
pyobjc-framework-AVFoundation==9.0
pyobjc-framework-AVKit==9.0
pyobjc-framework-BusinessChat==9.0
pyobjc-framework-CalendarStore==9.0
pyobjc-framework-CallKit==9.0
pyobjc-framework-CFNetwork==9.0
pyobjc-framework-ClassKit==9.0
pyobjc-framework-CloudKit==9.0
pyobjc-framework-Cocoa==9.0
pyobjc-framework-Collaboration==9.0
pyobjc-framework-ColorSync==9.0
pyobjc-framework-Contacts==9.0
pyobjc-framework-ContactsUI==9.0
pyobjc-framework-CoreAudio==9.0
pyobjc-framework-CoreAudioKit==9.0
pyobjc-framework-CoreBluetooth==9.0
pyobjc-framework-CoreData==9.0
pyobjc-framework-CoreHaptics==9.0
pyobjc-framework-CoreLocation==9.0
pyobjc-framework-CoreMedia==9.0
pyobjc-framework-CoreMediaIO==9.0
pyobjc-framework-CoreMIDI==9.0
pyobjc-framework-CoreML==9.0
pyobjc-framework-CoreMotion==9.0
pyobjc-framework-CoreServices==9.0
pyobjc-framework-CoreSpotlight==9.0
pyobjc-framework-CoreText==9.0
pyobjc-framework-CoreWLAN==9.0
pyobjc-framework-CryptoTokenKit==9.0
pyobjc-framework-DeviceCheck==9.0
pyobjc-framework-DictionaryServices==9.0
pyobjc-framework-DiscRecording==9.0
pyobjc-framework-DiscRecordingUI==9.0
pyobjc-framework-DiskArbitration==9.0
pyobjc-framework-DVDPlayback==9.0
pyobjc-framework-EventKit==9.0
pyobjc-framework-ExceptionHandling==9.0
pyobjc-framework-ExecutionPolicy==9.0
pyobjc-framework-ExternalAccessory==9.0
pyobjc-framework-FileProvider==9.0
pyobjc-framework-FileProviderUI==9.0
pyobjc-framework-FinderSync==9.0
pyobjc-framework-FSEvents==9.0
pyobjc-framework-GameCenter==9.0
pyobjc-framework-GameController==9.0
pyobjc-framework-GameKit==9.0
pyobjc-framework-GameplayKit==9.0
pyobjc-framework-ImageCaptureCore==9.0
pyobjc-framework-IMServicePlugIn==9.0
pyobjc-framework-InputMethodKit==9.0
pyobjc-framework-InstallerPlugins==9.0
pyobjc-framework-InstantMessage==9.0
pyobjc-framework-Intents==9.0
pyobjc-framework-IOSurface==9.0
pyobjc-framework-iTunesLibrary==9.0
pyobjc-framework-KernelManagement==9.0
pyobjc-framework-LatentSemanticMapping==9.0
pyobjc-framework-LaunchServices==9.0
pyobjc-framework-libdispatch==9.0
pyobjc-framework-LinkPresentation==9.0
pyobjc-framework-LocalAuthentication==9.0
pyobjc-framework-MapKit==9.0
pyobjc-framework-MediaAccessibility==9.0
pyobjc-framework-MediaLibrary==9.0
pyobjc-framework-MediaPlayer==9.0
pyobjc-framework-MediaToolbox==9.0
pyobjc-framework-Metal==9.0
pyobjc-framework-MetalKit==9.0
pyobjc-framework-MetalPerformanceShaders==9.0
pyobjc-framework-MetalPerformanceShadersGraph==9.0
pyobjc-framework-MLCompute==9.0
pyobjc-framework-ModelIO==9.0
pyobjc-framework-MultipeerConnectivity==9.0
pyobjc-framework-NaturalLanguage==9.0
pyobjc-framework-NetFS==9.0
pyobjc-framework-Network==9.0
pyobjc-framework-NetworkExtension==9.0
pyobjc-framework-NotificationCenter==9.0
pyobjc-framework-OpenDirectory==9.0
pyobjc-framework-OSAKit==9.0
pyobjc-framework-OSLog==9.0
pyobjc-framework-PassKit==9.0
pyobjc-framework-PencilKit==9.0
pyobjc-framework-Photos==9.0
pyobjc-framework-PhotosUI==9.0
pyobjc-framework-PreferencePanes==9.0
pyobjc-framework-PushKit==9.0
pyobjc-framework-Quartz==9.0
pyobjc-framework-QuickLookThumbnailing==9.0
pyobjc-framework-ReplayKit==9.0
pyobjc-framework-SafariServices==9.0
pyobjc-framework-SceneKit==9.0
pyobjc-framework-ScreenSaver==9.0
pyobjc-framework-ScreenTime==9.0
pyobjc-framework-ScriptingBridge==9.0
pyobjc-framework-SearchKit==9.0
pyobjc-framework-Security==9.0
pyobjc-framework-SecurityFoundation==9.0
pyobjc-framework-SecurityInterface==9.0
pyobjc-framework-ServiceManagement==9.0
pyobjc-framework-Social==9.0
pyobjc-framework-SoundAnalysis==9.0
pyobjc-framework-Speech==9.0
pyobjc-framework-SpriteKit==9.0
pyobjc-framework-StoreKit==9.0
pyobjc-framework-SyncServices==9.0
pyobjc-framework-SystemConfiguration==9.0
pyobjc-framework-SystemExtensions==9.0
pyobjc-framework-UniformTypeIdentifiers==9.0
pyobjc-framework-UserNotifications==9.0
pyobjc-framework-UserNotificationsUI==9.0
pyobjc-framework-VideoSubscriberAccount==9.0
pyobjc-framework-VideoToolbox==9.0
pyobjc-framework-Virtualization==9.0
pyobjc-framework-Vision==9.0
pyobjc-framework-WebKit==9.0
pyrsistent==0.19.2
requests==2.28.1
rlp==2.0.1
six==1.16.0
toolz==0.12.0
urllib3==1.26.13
varint==1.0.2
web3==5.31.1
websockets==9.1
yarl==1.8.1

What was wrong?

Please include any of the following that are applicable:

As I was trying to figure out the way to send the custom (stable coins in particular) coins from one bsc address to another, I have encountered this "{'code': -32000, 'message': 'invalid sender'}" error no matter how I try to do things. The code example might not be the best, but I decided that this is the best way to make sure that it's not an issue of the private key. This snippet maintains connection to the node while I deposit some amount of bnb to the newly-created wallet, after the deposit is successful, I let the code run further, where it fails to send the transaction to the node. (Yes, I know I tried using send_transaction on a already-signed transaction, but I was just making sure that it wouldn't work)

As a result, neither methods (send_transaction/send_raw_transaction) have been able to accomplish what I intended. The output was next:

XXXX57bfb378a44c3f21bbc1a516707f41820f74ec00d787fb136a056e3dXXXX # this is the private key that was generated, X for security
0x27e7a8D17B18DC29F233785D046605162F1C24A7 # this is the address of the newly-generated address
did you deposit
couldnt send trans a bytes-like object is required, not 'str' # send_transaction failed
couldnt send raw {'code': -32000, 'message': 'invalid sender'} # send_raw_transaction failed

Clueless on how to dabble the problem from this point on. Please give some suggestions

How can it be fixed?

Fill this section in if you know how this could or should be fixed.


Note: We prefer to use issues to track our work. If you think you've encountered a bug in web3py or have a feature request, you're in the right place. If you have implementation or usage questions, please refer to our documentation and/or join the conversation on discord.

fselmo commented 1 year ago

Hey @fantarics, I would highly suggest asking usage questions in the Dicord. This message is not coming from the library itself. It may be that you need to use gasPrice over maxFeePerGas and maxPriorityFeePerGas. Best of luck.