online resources

Prepare transcation and show QR

I would show a QR code on my webshop, which contains my BTC address and the price of the product I sell. LIKE THIS, BUT PREPARED PROGRAMMATICALLY: I guess I should use bitcoinjs-lib, right? What will happen with the unsent money of the buyer? It will be sent back to an other address of him / her?

Continue Reading Prepare transcation and show QR

Prepare Bitcoin transaction with amount and recipient, show as QR

I would show a QR code on my webshop, which contains my BTC address and the price of the product I sell. LIKE THIS, BUT PREPARED PROGRAMMATICALLY: I guess I should use bitcoinjs-lib, right? I found this example: https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/test/integration/transactions.spec.ts What I do not understand, 1: why all these parameters need, or can I call only psbt.addOutput({ address: '1KRMKfeZcmosxALVYESdPNez1AP1mEtywp', value: 80000, }); 2: how do I "export it" to string, from which I can generate a QR I can show. const psbt = new bitcoin.Psbt(); psbt.setVersion(2); // These are defaults. This line is not needed. psbt.setLocktime(0); // These are defaults. This…

Continue Reading Prepare Bitcoin transaction with amount and recipient, show as QR

How to use Digital Signature to Sign Unsigned Transaction?

so I was trying to sign my unsigned transaction: 010000000194d612f5ec40d483ed82bf346d8f08961d61fdf2d6b9804d7731e608d816e5330000000000ffffffff01204e0000000000001600143b36ddb4d9f75f4010450b25a8952a6725981bfb00000000 with a digital signature (ECDSA SIGNATURE in hex representation) I created based on this unsigned transaction which is: 3044022098f9780241fdd9f87a222a85cc65140f61913476c2d3c0f886e328a03f897ea4022089388ea886bb4d2440893665dc54fb7d4a0498766b4752b15415fb18dc38b72a. How to serialize these two so that I can use this digital signature to sign the unsigned transaction. Any explanation, example or any package (in Node.js) or otherwise also would be really helpful. I tried finding examples and test cases and even went through code for bitcoinjs-lib but I've not been able to find a single example of using a digital signature to sign and send a transaction. Most of them…

Continue Reading How to use Digital Signature to Sign Unsigned Transaction?

Using a bitcoin library to create digital signatures in TypeScript/Javascript

I have been trying to sign my transactions with a digital signature for the past few days but seems that libraries in bitcoin, as far as to my knowledge do not provide a simple way to sign the transactions with digital signatures. I have been trying to use bitcoinjs-lib to achieve my result. Bitcoinjs-lib came out with a new way of signing transactions with the class Psbt (partially signed bitcoin transaction) and I have been trying to serialize the unsigned transaction and then create a signature with the unsigned transaction and then finally sign the transaction with the signature. These…

Continue Reading Using a bitcoin library to create digital signatures in TypeScript/Javascript

How to verify the compressed signature in bitcoin? It is 138 long in hex

I am using bicoinjs-message npm module for signature verification. I learned that there are few signatures which are of length 138 in hexa-decimal. When I tried to verify this signature it is throwing error Error: Invalid signature length. How to verify the compressed signature? I think there is a lib in ruby which verify it, but i don't know ruby. bitcoin-ruby 0.0.20

Continue Reading How to verify the compressed signature in bitcoin? It is 138 long in hex

End of content

No more pages to load