-
Notifications
You must be signed in to change notification settings - Fork 20.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Insufficient Funds Error When Sending Transaction Despite Positive Balance #30702
Comments
why don't use this method to sign the tnx?
go-ethereum/core/types/transaction_signing.go Line 105 in 25bc077
|
Hi @hadv 😃, thanks for the help! In my setup, I'm creating private keys directly within AWS KMS. Due to security restrictions in KMS, I can't access the private keys directly; I can only obtain the associated public keys. I've been following this approach: https://jonathanokz.medium.com/secure-an-ethereum-wallet-with-a-kms-provider-2914bd1e4341 |
As a sanity check, can you recover the address from the signed tx and verify that it matches an account with funds? |
@jwasinger I tried something like this, but the address I obtained is different from the real sender and has 0 balance. signer := types.NewEIP155Signer(chainID)
sender, err := types.Sender(signer, signedTx)
fmt.Printf("Sender Address %v - Balance: %v\n", ethAddress1, getWeiBalance(ethAddress1))
fmt.Printf("Sender Address from signature %v - Balance: %v\n", sender, getWeiBalance(sender)) Output
|
Yeah, that's what I expected. You are somehow signing it incorrectly. I don't really have an answer right now, but I can try and look into this. |
I think that this one is not always correct |
@hadv you're right, I still need to add the check but since I tried several times with both values I don't think that is the problem. |
I'm encountering an issue where
BalanceAt()
correctly shows a balance of 5 * 10^16 wei for a wallet on the Sepolia testnet. However, when callingSendTransaction()
to send 1 wei to a second wallet , I get an error indicating the balance is 0:Output
Code (main.go)
The text was updated successfully, but these errors were encountered: