-
Notifications
You must be signed in to change notification settings - Fork 442
Open
Description
Hello.
Could you write an example of creating a transaction, signing it, and obtaining a transaction hash that can be sent further - having:
- only with private key
- only private key in WIF format
So I don't know nothing about prev tx and so on. I have only private key in diff formats which I get from:
private function generateWallet()
{
$oPrivateKeyFactory = new PrivateKeyFactory();
$oRandom = new Random();
$this->sPrivateKey = $oPrivateKeyFactory->generateCompressed($oRandom);
$this->sPrivateKeyWif = $this->sPrivateKey->toWif();
$this->sPublicKey = $this->sPrivateKey->getPublicKey();
$sPublicKeyHash = $this->sPublicKey->getPubKeyHash();
$oAddress = new PayToPubKeyHashAddress($sPublicKeyHash);
$this->sAddress = $oAddress->getAddress($this->oNetwork);
$oSegwitAddress = new SegwitAddress(WitnessProgram::v0($sPublicKeyHash));
$this->sSegwitAddress = $oSegwitAddress->getAddress();
}I read these links and many others, but they didn't help me:
- How to transfer BTC from a P2SH address? #895
- how to preform a basic transaction without flying numbers #861
- How to do these basics actions ? #849
- how can I sign it using bitcoin-php version 1.0? #835
- How to make a transaction with multiple outputs and sign it #790
- signing / checking 2:2 multisig transaction #780
- https://stackoverflow.com/questions/73182011/trying-to-generate-wallet-addresses-from-master-public-key-using-the-bitwasp-bit
- https://github.com/Bit-Wasp/bitcoin-php/blob/1.0/examples/doc/tx/003_create_txout.php
I need a simple solution: received the keys, the address, created a transaction, signed, sent (I know that I a not empty balance).
Thanks.
Metadata
Metadata
Assignees
Labels
No labels