0

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!

12
  • Are you creating a custodial wallet service? What is the role of what you are creating? Jul 10 at 15:29
  • 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
    Jul 10 at 15:36
  • 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? Jul 10 at 16:01
  • 1
    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. Jul 10 at 16:27
  • 1
    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. Jul 10 at 16:45

1 Answer 1

0

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 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.