blockchain / service-my-wallet-v3

Blockchain Wallet API Service
https://blockchain.info/api/blockchain_wallet_api
GNU Affero General Public License v3.0
915 stars 519 forks source link

What is the deprecated replacement in HD API? #234

Open tinodj opened 7 years ago

tinodj commented 7 years ago

Hi,

I can see for several endpoints you are saying "deprecated, use the HD API instead. Can you please explain what is the HD API for them? I am specifically interested in the following but didn't find how to make them work. The deprecated is also not working for me because the wallet is HD.

List Addresses (deprecated, use the HD API instead) Fetch Address Balance (deprecated, use the HD API instead)

Thanks a lot, Valentin

jtormey commented 7 years ago

The HD API lets you use "accounts" instead of individual addresses.

Instead of generating a new address to receive funds, our wallet will derive a new one for you for each payment. Get the next address in an account.

To spend from an account, just set the from parameter in the send endpoint to the index of the account you want to send from.

You can use the account balance endpoint to get the balance of one of your accounts.

The nice thing about the HD API, compared to the deprecated API, is that all of your bitcoin can be safely backed up by recording your recovery phrase. You can find your recovery phrase by logging into your wallet in the web wallet interface.

tinodj commented 7 years ago

Hi,

Thanks!

how then I can find all my addresses in the HD wallet (I know that they are indexed from 0 on), but how I can list all of them, check their balance, and then maybe send from that index.

So: How to iterate through the indexes obtaining balance and the address of that index?

In addition, how to create 10 new addresses ?

Best, Valentin

jtormey commented 7 years ago

Some of those features aren't supported, since the idea of accounts is to have the wallet software manage your addresses for you. Because of this, there's no way to send from or check the balance of individual addresses in an account.

To find all addresses in your hd wallet, as of now you'll have to derive them yourself. If you're using Javascript, the BitcoinJS library works great for this.

You might be interested in our Receive Payments API, it's built to allow you to easily receive payments to an HD account. Using it you could easily generate 10 addresses, and receive an HTTP notification when each receives bitcoin.

Hope that helps. If not, could you tell me why you need these features (what your use case is)? If it's something we don't have a solution for yet (and makes sense in the context of HD wallets) I could look into implementing them.

tinodj commented 7 years ago

Hi and thank you for taking time for this.

You are saying that the wallet SW should manage addresses inside the accounts, but the problem here is that your wallet software is not managing these things very well. Actually it leads to many unspent outputs, and then I need to write a program that will take care/consolidate these many unspent outputs - since the wallet software is not taking care of them.

I do use Receive Payments API and I am not sure why you are maintaining more APIs when you can have one API and maintain it to be able to do everything that is needed.

I've just tried to explain my use case in the first paragraph and if you give me solution without using these features I will be even more happy to hear about it. So thanks a lot for your offer to help me with this and let me know how I should approach consolidating outputs problem.

Best, Valentin

tinodj commented 7 years ago

Hi Justin,

do you have an idea how I can consolidate many outputs ? I can see from the API I can not any longer choose the index of address of the HD, but just the index of the account. And my unspent outputs are in one account. Any idea how we can do this?

Or if you maybe give me answers to the following questions: how I can pick the outputs that I want to spend/group ? Or how the algorithm is picking them? I though by how old they are - but obviously it is not - I have some very old unspent outputs (more than 6 months). Or in other words - do you plan to support something similar like: listunspent and createrawtransaction ?

Best, Valentin

oladapopaul commented 7 years ago

Hello,

I'm enjoying this conversation, however I'm working on a project that has to do with blockchain that needs the wallet to accept and send funds, so how do I get the HD Api wallet approved?

I need this kind of wallet so as not to experience the limits of set for blockchain wallet api usage https://btcthreads.com/create-brand-new-addresses-with-blockchain-info-api/

Please, I will appreciate your support.

majidkhanhurmaz commented 6 years ago

{"address":"1HUkkXPp7BV1bD5W7jphzF6WJCjmpxvuHH","warning":"This endpoint has been deprecated, for the best safety and security, use the HD API instead: https://github.com/blockchain/service-my-wallet-v3#enable-hd-functionality"}

this is the output of my coding i want to generate the new address but its come this message with new btc

please help me on above warning message

udokaezepue commented 4 years ago

Why the HD doesn't have the API documentation as it is here https://www.blockchain.com/api/blockchain_wallet_api to enable us developers to know what and what to do.

udokaezepue commented 4 years ago

Hi and thank you for taking time for this.

You are saying that the wallet SW should manage addresses inside the accounts, but the problem here is that your wallet software is not managing these things very well. Actually it leads to many unspent outputs, and then I need to write a program that will take care/consolidate these many unspent outputs - since the wallet software is not taking care of them.

I do use Receive Payments API and I am not sure why you are maintaining more APIs when you can have one API and maintain it to be able to do everything that is needed.

I've just tried to explain my use case in the first paragraph and if you give me solution without using these features I will be even more happy to hear about it. So thanks a lot for your offer to help me with this and let me know how I should approach consolidating outputs problem.

Best, Valentin

How can i send Bitcoin to another wallet (Using PHP) with this HD upgraded API. ? please someone should help me, i started using blockchain API v1 and it is cool, i can send Bitcoin with the API code, query Balance, Query lists etc. But to use this HD API, i don't know the code that will help me to send Bitcoin to another wallet. Please i need help, or if there is another Platform that offers a good and understanding API with PHP, someone should help me.