<p>The process described in the question is not the way normal transactions are created and processed in Bitcoin.</p>
<p>You can request payment by, for example, showing the customer a barcode (QR-code)<sup>†</sup> that contains the address you want to be paid and the amount. Alternatively you just show them the address and amount in plain text. As a <a href="https://developer.bitcoin.org/devguide/payment_processing.html" rel="nofollow noreferrer">developer web-page on payment processing</a> implies, the customer creates the whole transaction themselves without any assistance. They might typically use a wallet app to scan the barcode and press &quot;send&quot;.</p>
<p>When your wallet observes any payment to the given address, including unconfirmed payments, it will,  as part of verification, calculate the TxHash (Transaction-ID, a hash of transaction data).</p>
<hr />
<p>There is provision for more complex forms of transaction. For example multisignature transactions and partially signed bitcoin transactions (PSBT). There is also Lightning, Liquid etc. However, it isn't clear from the information provided that any of these are relevant to you.</p>
<hr />
<p><sup>†</sup> See <a href="https://bitcoin.stackexchange.com/q/4987/13866">Bitcoin URL scheme</a></p>

CC BY-SA 4.0
2022-07-12T10:17:36.310Z
2022-12-09T15:04:50.013Z
2022-12-09T15:04:50.013Z
RedGrittyBrick
<p>I'm trying to create a transaction and send it to the blockchain.</p>
<p>The goal is to get an address from which the money comes and an address to which the money will go, send the transaction to the network, wait for the wallet owner from which the money comes to approve the transaction in his wallet and finally get the transaction address.</p>
<p>I can not understand how to do this without asking the wallet owner from whom the money was sent the private key.</p>
<p>I would appreciate your help,
Thanks!</p>

CC BY-SA 4.0
2022-07-10T15:29:25.747Z
Are you creating a custodial wallet service? What is the role of what you are creating?
RedGrittyBrick
CC BY-SA 4.0
2022-07-10T15:36:16.847Z
No. What I need is simple, a customer enters a web form, enters his wallet address (from which bitcoin came out), address to which he will send the bitcoin, how much bitcoin to send.
I want to transmit the transaction to the network, the customer in his wallet (Electrum, Exodus Etc.) will confirm the transaction, it will be executed and finally I will receive the TxHash of the transaction.
Salvador
CC BY-SA 4.0
2022-07-10T16:01:37.580Z
I still don't understand. Why wouldn't the customer do the whole job in Electrum, Exodus etc. Why would they want to involve a 3rd-party web-page? Is this multisig escrow PSBT or something else?
RedGrittyBrick
CC BY-SA 4.0
2022-07-10T16:21:06.530Z
They need to do the transaction through me so I get their TxHash automatically.
Salvador
CC BY-SA 4.0
2022-07-10T16:27:53.940Z
Well what you're asking for is fundamentally impossible. You need the user's wallet to produce the signatures in the transaction inputs. Without those, the transaction is incomplete, invalid, and the network won't relay such transactions.
Pieter Wuille
CC BY-SA 4.0
2022-07-10T16:35:20.433Z
I want to prepare the transaction for him, send it to the network, he will confirm it in his wallet and finally I will receive the transaction address
Salvador
CC BY-SA 4.0
2022-07-10T16:36:39.527Z
I manage to do it on the Etherium network and it works great. In Bitcoin I do not succeed
Salvador
CC BY-SA 4.0
2022-07-10T16:45:51.373Z
The Bitcoin network does not relay transactions that aren't valid. You'll need to communicate with the user out of band, using protocols like PSBT, to construct the transaction.
Pieter Wuille
CC BY-SA 4.0
2022-07-11T08:07:25.597Z
look at this: https://developer.bitcoin.org/devguide/payment_processing.html  By 'Requesting Payments' it is impossible to do so?
Salvador
CC BY-SA 4.0
2022-07-11T09:23:36.107Z
You "Request payment" by, for example, showing the customer a barcode (QR-code) that contains the address you want to be paid and the amount. Alternatively you just show them the address and amount in plain text. As that developer web-page implies, the customer creates the whole transaction themselves without any assistance. They might typically use a wallet app to scan the barcode and press "send". See https://bitcoin.stackexchange.com/q/4987/13866
RedGrittyBrick
CC BY-SA 4.0
2022-07-11T17:13:33.947Z
The question is if there is a way I can do that and get TxHash automatically?
Salvador
CC BY-SA 4.0
2022-07-12T09:54:42.727Z
When your wallet observes any payment to the given address it will be able to calculate the TxHash.
RedGrittyBrick
<transactions><blockchain><bitcoin-core-development><bitcoin-cli>
How to obtain transaction-ID for a payment?
Salvador
# How to obtain transaction-ID for a payment?

(Asked by: username_0 on 2022-07-10)

I'm trying to create a transaction and send it to the blockchain.

The goal is to get an address from which the money comes and an address to which the money will go, send the transaction to the network, wait for the wallet owner from which the money comes to approve the transaction in his wallet and finally get the transaction address.

I can not understand how to do this without asking the wallet owner from whom the money was sent the private key.

I would appreciate your help,
Thanks!

**Tags:** transactions, blockchain, bitcoin-core-development, bitcoin-cli

> **Comments:**
> **username_1**: Are you creating a custodial wallet service? What is the role of what you are creating?  
> **username_0**: No. What I need is simple, a customer enters a web form, enters his wallet address (from which bitcoin came out), address to which he will send the bitcoin, how much bitcoin to send. I want to transmit the transaction to the network, the customer in his wallet (Electrum, Exodus Etc.) will confirm the transaction, it will be executed and finally I will receive the TxHash of the transaction.  
> **username_1**: I still don't understand. Why wouldn't the customer do the whole job in Electrum, Exodus etc. Why would they want to involve a 3rd-party web-page? Is this multisig escrow PSBT or something else?  
> **username_0**: They need to do the transaction through me so I get their TxHash automatically.  
> **username_2**: Well what you're asking for is fundamentally impossible. You need the user's wallet to produce the signatures in the transaction inputs. Without those, the transaction is incomplete, invalid, and the network won't relay such transactions.  
> **username_0**: I want to prepare the transaction for him, send it to the network, he will confirm it in his wallet and finally I will receive the transaction address  
> **username_0**: I manage to do it on the Etherium network and it works great. In Bitcoin I do not succeed  
> **username_2**: The Bitcoin network does not relay transactions that aren't valid. You'll need to communicate with the user out of band, using protocols like PSBT, to construct the transaction.  
> **username_0**: look at this: https://developer.bitcoin.org/devguide/payment_processing.html  By 'Requesting Payments' it is impossible to do so?  
> **username_1**: You "Request payment" by, for example, showing the customer a barcode (QR-code) that contains the address you want to be paid and the amount. Alternatively you just show them the address and amount in plain text. As that developer web-page implies, the customer creates the whole transaction themselves without any assistance. They might typically use a wallet app to scan the barcode and press "send". See https://bitcoin.stackexchange.com/q/4987/13866  
> **username_0**: The question is if there is a way I can do that and get TxHash automatically?  
> **username_1**: When your wallet observes any payment to the given address it will be able to calculate the TxHash.  

---

## 1 answers

### Answer by username_1 on 2022-07-12. Score: 1

The process described in the question is not the way normal transactions are created and processed in Bitcoin.

You can request payment by, for example, showing the customer a barcode (QR-code)† that contains the address you want to be paid and the amount. Alternatively you just show them the address and amount in plain text. As a [developer web-page on payment processing](https://developer.bitcoin.org/devguide/payment_processing.html) implies, the customer creates the whole transaction themselves without any assistance. They might typically use a wallet app to scan the barcode and press "send".

When your wallet observes any payment to the given address, including unconfirmed payments, it will, as part of verification, calculate the TxHash (Transaction-ID, a hash of transaction data).

---

There is provision for more complex forms of transaction. For example multisignature transactions and partially signed bitcoin transactions (PSBT). There is also Lightning, Liquid etc. However, it isn't clear from the information provided that any of these are relevant to you.

---

† See [Bitcoin URL scheme](https://bitcoin.stackexchange.com/q/4987/13866)


---

