Bitcoin Forum
June 17, 2024, 06:17:42 AM *
News: Voting for pizza day contest
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Development & Technical Discussion / Re: Generating payment addresses from a user's public key on: September 11, 2019, 05:58:52 PM
1. User provides it's public key (xpub)
i'm confused, why does the "user" provide his xpub if it is "you" who is accepting payments?

3. After that a cron job queries the blockhain for the generated address and checks whether the payment has been made.
4. if balance for the address is equal to the order price the order is marked as paid.
we cannot run a full bitcoin node for that.
so you are relying on a third party to do this verification for you? it doesn't sound safe, specially if the payments are not small.
also you should look for "transaction" not just balance. of course since RBF is a thing you have to keep looking. the benefit of this is that as soon as you receive the transaction you can show a message to the user so that they don't have to wait in the dark without knowing if the site is broken or not.
a message saying "we've receive this transaction (txid) which has (low/medium/high) fee and needs (x) number of confirmation, it currently has (y)".

you could also run bitcoin core in pruned mode which requires less resources. again it depends on the size and frequency of payments you are receiving.

Thanks all for your replies.

The main idea is allow an administrator to receive payments from other users that will order goods on the marketplace.

There is no way we can run the full node.
So what is the best option in this case? Can I use current flow (with an xpub key) in that case? I understand that is not safe to query a third party service to check a transaction state.
But we have some limitations.
I just want to know maybe there are any other types of wallets that allows an owner to provide some public key to generate new payment addresses.

Thanks
2  Bitcoin / Development & Technical Discussion / Generating payment addresses from a user's public key on: September 01, 2019, 08:20:55 PM
Hi, I've already implemented a custom script for that purpose, it works in the following way.

1. User provides it's public key (xpub)
2. the scripts takes this xpub key and every time an order is made it generates a new payment address
3. After that a cron job queries the blockhain for the generated address and checks whether the payment has been made.
4. if balance for the address is equal to the order price the order is marked as paid.

It works, however I am wondering whether there is a better way to implement this task now?

I can't use any existing gateways like bitpay and others. It should be a custom application/script and we cannot run a full bitcoin node for that.

I would be grateful for any suggestions.
3  Bitcoin / Development & Technical Discussion / Re: Verifying bitcoin payments manually, how to determine concrete payment payment on: July 20, 2018, 03:17:02 AM
Thank you for answers, so generally it is fine to generate a new address for a new order.

The only one limitation I see here that not all wallets support checking balance and operating fund for a wallet that has a lot of derived addresses.

However i always can do this by myself iterating over generated addresses manually and collecting funds, am I right ?
4  Bitcoin / Development & Technical Discussion / Re: Verifying bitcoin payments manually, how to determine concrete payment payment on: July 15, 2018, 02:28:37 PM
Thank you so much, but this won't solve the main problem.

I don't want to generate a thousands of new addresses for each order.
I want to reuse some pool of addresses for different orders.

For instance in case of 20 addresses I can have a chance to have several pending payments for a single address.
How to solve this problem and verify that a concrete order was paid?
5  Bitcoin / Development & Technical Discussion / Verifying bitcoin payments manually, how to determine concrete payment payment on: July 14, 2018, 08:19:57 PM
Hi,

I am a developing a simple bitcoin payment gateway leveraging Electrum servers for checking balance of generated addresses.

Initially I had the following idea.

1. A customer makes an order
2. A new bitcoin address generated from a BIP32 wallet
3. The generated address is assigned to the order id
4. As far as we have amount of the order, we periodically checking whether funds were received to the generated address
5. In case funds are received and a transaction is confirmed order is marked as paid

But as I have explored, most of available wallets have limited generated receive addresses. But in case of the flow above I need to generate a new address for each new order.

Generally that is not a problem from the math perspective, but this will introduce some problems when I need to spend money from the wallet or just calculate total balance, because there could be thousands of addresses.

We can generate some limited amount of addresses for instance 20 and then randomly select from this list.
However in that case I don't know how to validate payments. There are a lot of problems that I may encounter in that case.
For instance, when several orders with the same total price are made.

Please suggest a solution for that problem ?

I would be grateful for any help
6  Bitcoin / Development & Technical Discussion / Re: How to securely generate addresses of an HD wallet? on: July 04, 2018, 10:49:43 PM
Thank you so much for your help !!

For who are interested, I have tested the Electrum wallet and it generates addresses using the following paths

Code:
m/0/<n> path (receiving addresses)
m/1/<n> path (change addresses)

By default 20 Receive Addresses and 6 Change addresses are generated by Electrum
7  Bitcoin / Development & Technical Discussion / Re: How to securely generate addresses of an HD wallet? on: July 03, 2018, 01:39:07 PM
I am really thank for your answers !! Really appreciate your help !

I have found the following answer https://bitcoin.stackexchange.com/questions/36955/what-bip32-derivation-path-does-electrum-use/36956

And in case I will use a BIP32 compatible wallet I have to generate addresses using the following format

Code:
m/0/k - Receive address
m/1/k - Change address

Where K is the address index.

All in all, the main question I am interested in, as far as this is only a convention, how do I know what format should I use? For instance one user uses the Electrum wallet another user uses the Bitcoin Core wallet.

What is the right strategy for generating addresses for different HD wallets?

Thanks. 
8  Bitcoin / Development & Technical Discussion / Re: How to securely generate addresses of an HD wallet? on: July 02, 2018, 06:36:06 PM
Thank you so much for such detailed and useful answers.  I have one more question regarding the path of derived addresses

I have read the specification, but didn't understand whether this is required of this is just a convention?

For instance consider the following path
Code:
Bitcoin	first	external	first	m / 44' / 0' / 0' / 0 / 0



If I change the constant number 44, what consequences may I experience? As far as I know all online tools for calculating balances just check all available values to calculate the final balance.

And in case the last value corresponds to a address index, what is the maximum value of addresses though ?

And if there any lib, that just makes it simple to derive and address passing all these values as function argument to generate a valid new address?
9  Bitcoin / Development & Technical Discussion / Re: How to securely generate addresses of an HD wallet? on: June 30, 2018, 05:38:08 PM
Thank you so much for the answer, appreciate your help.

Could you please explain the following things

1. For instance using this library https://github.com/dan-da/hd-wallet-derive , there are different ways for generating bitcoin address, xprv, xpub, mnemonic. Which one is safer and better for using by users.
2. If using derivation from xpub key, are there any limits for generating number of addresses ?
3. If someone will get my xprv key, can he access my funds ?
4. Do I have a chance to derive the same key several times using an XPUB key

I would be grateful for help.

Thx.
10  Bitcoin / Development & Technical Discussion / Re: How to securely generate addresses of an HD wallet? on: June 29, 2018, 07:25:25 PM
Thank you so much for the reply. Generally there is no risk, because users will just paste their XPUB keys in their profile settings, this will encrypted and then used for generating a bunch of new addresses.

But I haven't found any example how can I derive new addresses from an XPUB key, also I found that I still need the private key to generate new addresses.

All in all, I am just looking for a way for users to provide some part of their credentials that won't allow in that case me to access their wallets. But allow my scripts to generate new addresses.

Please suggest the best way to achieve that.
THanks
11  Bitcoin / Development & Technical Discussion / How to securely generate addresses of an HD wallet? on: June 29, 2018, 06:51:27 PM
I need a way to provide something public or at least not usable to access my Bitcoin account.

The idea is simple, to allow users to add theirs public credentials that will be used for generating new addresses.

I have read about HD wallets and as far as I know there is the XPUB key, that can be used to generate new addresses. But I haven't found any example how to do this programatically.

So generally

  • A user own an HD wallet
  • The user does something and gets something, that can be used for generating new addresses, of course connected to the root wallet
  • The user provides this public credentials for generating new addresses.
  • Some script generates a new address every time this is required using provided credentials.

Could someone route me to the right direction? Any language is acceptable, but it would be great if this will be possible using Golang

And please tell me, why it is dangerous to create a new wallet locally (generally this is just a set of private/public key) but why I need to run the full node to have a wallet?
12  Economy / Web Wallets / Re: Unable to send money from a Blocktrail wallet !!! on: November 14, 2017, 05:57:14 PM
Here what I've been watching for a few days
13  Economy / Web Wallets / Unable to send money from a Blocktrail wallet !!! on: November 14, 2017, 05:14:18 PM
Hi, I've been using https://www.blocktrail.com/ for a while for payments using the API provided.
Yesterday I decided to send bitcoins from my blocktrail wallet to my another wallet.

But I have encountered a problem. The problem that the process gets stuck with the message "Decrypting Wallet" and it won't proceed any further.

I have tried to send bitcoins today, but got the same problem !!

Furthermore I contacted support, but they replied with a completely unrelated message !!

Does anyone else have problems with this service ?!

How can I send my money from the wallet ?
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!