Skip to content
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

Signature is not valid #1212

Closed
adysrecovery opened this issue Sep 22, 2023 · 3 comments
Closed

Signature is not valid #1212

adysrecovery opened this issue Sep 22, 2023 · 3 comments
Assignees
Labels

Comments

@adysrecovery
Copy link

adysrecovery commented Sep 22, 2023

Hi all,
I am trying to send 1 flow token from an account using FLOW CLI.

CLI version Version: v1.4.3, Windows version
My flow config file:


{
	"networks": {
		"emulator": "127.0.0.1:3569",
		"mainnet": "access.mainnet.nodes.onflow.org:9000",
		"sandboxnet": "access.sandboxnet.nodes.onflow.org:9000",
		"testnet": "access.devnet.nodes.onflow.org:9000"
	},
	"accounts": {
		"adys": {
			"address": "MyAddress",
			"key": {
				"type": "hex",
				"index": 0,
				"signatureAlgorithm": "ECDSA_secp256k1",
				"hashAlgorithm": "SHA3_256",
				"privateKey": "mykey"
			}
		},
	}
}

The key extracted from Blocto service keystore using Metamask.
I checked the account and the signature and hash algorithms are the same.

I am trying to send our 1 FLOW token without success:

flow transactions send transfer_tokens.cdc "1.0" "DestinationAddress" -n mainnet --signer adys

I am using this template:

// This transaction is a template for a transaction that
// could be used by anyone to send tokens to another account
// that has been set up to receive tokens.
//
// The withdraw amount and the account from getAccount
// would be the parameters to the transaction

import FungibleToken from 0x9a0766d93b6608b7
import FlowToken from 0x7e60df042a9c0868

transaction(amount: UFix64, to: Address) {

    // The Vault resource that holds the tokens that are being transferred
    let sentVault: @FungibleToken.Vault

    prepare(signer: AuthAccount) {

        // Get a reference to the signer's stored vault
        let vaultRef = signer.borrow<&FlowToken.Vault>(from: /storage/flowTokenVault)
			?? panic("Could not borrow reference to the owner's Vault!")

        // Withdraw tokens from the signer's stored vault
        self.sentVault <- vaultRef.withdraw(amount: amount)
    }

    execute {

        // Get a reference to the recipient's Receiver
        let receiverRef =  getAccount(to)
            .getCapability(/public/flowTokenReceiver)
            .borrow<&{FungibleToken.Receiver}>()
			?? panic("Could not borrow receiver reference to the recipient's Vault")

        // Deposit the withdrawn tokens in the recipient's receiver
        receiverRef.deposit(from: <-self.sentVault)
    }
}

Template taken from here

I am getting

 Transaction Error
[Error Code: 1009] error caused by: 1 error occurred:
        * transaction verification failed: [Error Code: 1006] invalid proposal key: public key 0 on account <myaccount> does not have a valid signature: [Error Code: 1009] invalid envelope key: public key 0 on account <myaccount> does not have a valid signature: signature is not valid

Any idea what is the problem?
Where can I find a simple tx file to check? For example, tx.cdc like mention here just to see if what is the problem.
Signing offline simple messages using CLI is working good.

Thanks

@adysrecovery
Copy link
Author

adysrecovery commented Sep 22, 2023

update:

I derived the public key from the private key using the same algorithm:

flow keys derive <key> -n mainnet --sig-algo ECDSA_secp256k1
And I got the same public key that I have at index 3 that I got from this command:
flow accounts get <account>-n mainnet --include keys

I can see that this key is revoked:

Key 3	Public Key		 
       <key>
	Weight			 1000
	Signature Algorithm	 ECDSA_secp256k1
	Hash Algorithm		 SHA3_256
	Revoked 		 true
	Sequence Number 	 1
	Index 			 3

Trying to use this key (index 3) is giving me:

transaction verification failed: [Error Code: 1006] invalid proposal key: public key 3 on account <myaccount> does not have a valid signature: [Error Code: 1009] invalid envelope key: public key 3 on account <myaccount> does not have a valid signature: **account key has been revoked**

What exactly does it mean?
Can this happened as a result of password change in Blocto Service?
Can it be that it revoked the old keys?
I have 11 keys, first one (index 0) is ok, then 5 revoked (1-5), then 5 more are ok(6-10).

Is there any way to move the funds using my private key even that the paired derived key is revoked?
I extracted this key from the original keystore (before the password change) using Metamask.

Thanks

@nvdtf
Copy link
Member

nvdtf commented Sep 25, 2023

You cannot authorize any actions on an account with a revoked key. Do you control any private keys that have full control (1000 weight) and are not revoked?

@adysrecovery
Copy link
Author

Yes I realize that.
We didn't know that when Blocto change your password, they also revoking the old keys.

We had an account that we changed to non custody mode, got a keystore and password.
Few months later, changed the password again, got a new keystore and new password.

Password lost.
We tired to work with the key from the original keystore.
Blocto revoked those keys upon password change.

Closing ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants