I think you have some conception misunderstanding here. The bitcoin address is just a hash of a public key in base58 encoding. You can't generate a private key from an address because a hash function is a one-way function. You can't even generate a public key from an address for the same reason.
The right flow would be:
You somehow retrieve your keypair (public and private keys) - maybe you had one before or maybe you've just generated it.
You generate a hash of a public key - it is your bitcoin address now.
The keypair is used to sign your transactions, so everybody can cryptographically verify it.
The address is just a handy nym for your public key - it has fixed length and everybody can generate it from your public key.
I think you have some conception misunderstanding here. The bitcoin address is just a hash of a public key in base58 encoding. You can't generate a private key from an address because a hash function is a one-way function. You can't even generate a public key from an address for the same reason.
The right flow would be:
I think you didn't get my question, My question was is there any method to get privatekey
For Example i generated an address using below method
bitcoin.payments.p2pkh({ pubkey: node.publicKey, network }).address
but for signing raw transaction I need privatekey of this address 1FYtPnUZZ2ZJL2fZ6XehGtkHfujUHkqK3T
This is what i am asking, What should I do to get address and its privatekey?