Bitcoin Forum
May 30, 2024, 12:48:21 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Generate Receive Code Via API  (Read 230 times)
maxus033 (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
November 26, 2020, 05:16:20 AM
 #1

Hi,

What's the best API to create a wallet or a receive code and give users to send bitcoins?

I was working with BTC.com but their script is outdated and SDK files don't work on Laravel 8.0+

Need a secure API which allows creating a wallet using a API and generate a receive code to give to the user to submit bitcoins to.  

Then using API check the wallet's balance to see if any bitcoins has been sent.

* Also checked Blockchain API, the Registration form to get a API key doesn't even work there....
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
November 26, 2020, 06:22:23 AM
 #2

Do you need to create a separate wallet for each user and for them to be able to generate multiple addresses?  Or are you wanting to use one wallet that you control, and simply provide the users with a unique "deposit" address so they can send you bitcoins?

What exactly are you attempting to build? Huh

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
mocacinno
Legendary
*
Offline Offline

Activity: 3402
Merit: 5004


https://merel.mobi => buy facemasks with BTC/LTC


View Profile WWW
November 26, 2020, 06:32:49 AM
 #3

Why don't you run your own node using bitcoin core and use the json-rpc api directly? You can even install nbxplorer on top of your node and then run btcpayserver (depending on your usecase)

Or, in case there are resource restrictions, run an electrum node and use it's json-rpc api....

Cut out the middle man, no restrictions, no limits: be in controll of your own funds!

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
NotATether
Legendary
*
Online Online

Activity: 1624
Merit: 6854


bitcoincleanup.com / bitmixlist.org


View Profile WWW
November 26, 2020, 11:58:08 AM
 #4

You want to send QR codes to your users via an API? You should be able to construct a bitcoin QR code from creating the underlying URI and query string defined in BIP21, and then use a library to encode it into a QR code. Then return the image as base64.

I'm not fluent in PHP, but like mocacinno said, the JSON-RPC interface is always available. It will be helpful in checking if an address has had bitcoins sent to.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
maxus033 (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
November 28, 2020, 06:38:00 PM
 #5

Do you need to create a separate wallet for each user and for them to be able to generate multiple addresses?  Or are you wanting to use one wallet that you control, and simply provide the users with a unique "deposit" address so they can send you bitcoins?

What exactly are you attempting to build? Huh

In my platform users enter how much they want to pay as a donation and the system should give them a receive code to deposit the amount.

Basically just need to give the user an address to send money to. I wouldn't know who paid as they only get a wallet address to pay into. But I will only know if there's funds in the wallet as the wallet is new and only that end user has the address.


Thanks guys for the info.
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
December 04, 2020, 06:52:08 AM
Merited by ABCbits (1)
 #6

Depending on how much you're expecting to receive... Mycelium Gear offers a "free" service for up to 0.1BTC/month... once you tick over 0.1btc/month, there is a service fee of 0.5% per transaction

Essentially, you plug in a Master Public Key, and it takes care of the rest, and provides code and/or widgets you can use to embed the "donate" button on your website.

So, if you're after a quick and easy solution and you expect to get less than 0.1btc/month, it might be worth checking out. If you're expecting more and don't want the fees, then I'd be inclined to run a node and use something like btcpayserver like mocacinno suggested.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
bob123
Legendary
*
Offline Offline

Activity: 1624
Merit: 2481



View Profile WWW
December 04, 2020, 02:15:20 PM
 #7

I wouldn't know who paid as they only get a wallet address to pay into.

If you don't need to know which user sent you the donation, simply just use a single static address.
If you want to know which user sent you the donation, use a new address for each user. Depending on how your website is constructed this can be done with multiple tools.

You could use core, electrum or a centralized service provider. That's up to you. Searching the internet with your favorite search engine or using this forum search will yield enough results.

PrimeNumber7
Copper Member
Legendary
*
Offline Offline

Activity: 1624
Merit: 1899

Amazon Prime Member #7


View Profile
December 05, 2020, 05:25:08 AM
 #8


If you don't need to know which user sent you the donation, simply just use a single static address.

Address reuse leads to a reduction in privacy for everyone, and incremental reduction in security (I am guilty of this sometimes, as are many other people).

Ideally, the OP should generate a new address each time he receives a transaction, but at a minimum, he should generate a new address each time he spends any coin he received.  
bob123
Legendary
*
Offline Offline

Activity: 1624
Merit: 2481



View Profile WWW
December 05, 2020, 01:24:50 PM
Merited by ranochigo (1), ABCbits (1)
 #9

Address reuse leads to a reduction in privacy for everyone,

If OP is planning to post his address on a website, he obviously doesn't care that the address is being associated with his website.
Just as you have your address posted on your profile.

If you (as a sender; e.g. as donator) care about your privacy, you should not rely on the receiver. That would be a huge mistake.
If you care about your privacy, make sure that you send mixed coins. But don't rely on the receiver to always generate a new address for everyone.



and incremental reduction in security

Calling address reuse a reduction in security is exaggerated.



Ideally, the OP should generate a new address each time he receives a transaction

In OP's case this might not be necessary. So there is literally no good reason for him to invest time and work into something he might not need at all.
If i understood him correctly, a single static address is absolutely fine for him.

HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
December 07, 2020, 10:47:18 PM
 #10

I'm confused, if you just need to enter your Master Public Key, how Mycelium charge 0.5% service fee?
I have never gone over the 0.1 BTC threshold, but I suspect they will just "lock" your account so that the widgets no longer function and/or you are unable to log into your account if you refuse to pay up the service fee.

It seems to bill "in arrears"... mine says the next bill will be payable on Dec 9th... but is 0 BTC to pay as I have not received over the 0.1 BTC threshold.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
blocksdk
Newbie
*
Offline Offline

Activity: 16
Merit: 2


View Profile WWW
December 08, 2020, 04:02:48 AM
 #11

Recommend BLOCKSDK
You can create a wallet using the API.


Website
https://blocksdk.com

API Docs
https://docs.blocksdk.com/bitcoin#createwallet

SDK Github
https://github.com/Block-Chen/blocksdk-php

Code:
use BlockSDK;

$blockSDK = new BlockSDK("YOU_TOKEN");
$btcClient = $blockSDK->createBitcoin();

$wallet = $btcClient->createWallet([
    "name" => "test"
]);

var_dump($wallet);
PrimeNumber7
Copper Member
Legendary
*
Offline Offline

Activity: 1624
Merit: 1899

Amazon Prime Member #7


View Profile
December 08, 2020, 06:09:55 AM
 #12

Address reuse leads to a reduction in privacy for everyone,

If OP is planning to post his address on a website, he obviously doesn't care that the address is being associated with his website.
Just as you have your address posted on your profile.
Address reuse leads to a reduction of privacy for everyone. Not just the sender and receiver.

Posting an address on a website that remains static means everyone will be able to trivially gain insight into the finances of the OP. Posting an address that changes means that everyone can closely watch the OP's website to gain insight into his finances, but the casual observer will be unable gain substantial insight to how much the OP is receiving, and an observer would be unable to know how much the OP received before they start watching his website.
bob123
Legendary
*
Offline Offline

Activity: 1624
Merit: 2481



View Profile WWW
December 08, 2020, 09:54:52 AM
 #13

Address reuse leads to a reduction of privacy for everyone. Not just the sender and receiver.

If you care about your privacy, do something for it.
Don't rely on others.

It is absolutely irrelevant what someone else is doing if you want to preserve your privacy. If you rely on others, you already have lost.
There are multiple ways to increase the privacy with bitcoin. But relying on others to not reuse addresses definitely is not one of them.



Posting an address on a website that remains static means everyone will be able to trivially gain insight into the finances of the OP. Posting an address that changes means that everyone can closely watch the OP's website to gain insight into his finances, but the casual observer will be unable gain substantial insight to how much the OP is receiving, and an observer would be unable to know how much the OP received before they start watching his website.

So?
Again, if OP doesn't care and just wants to be able to receive donations.. then what is the problem with it?

If OP doesn't want this to be the case, that's absolutely fine. But if he doesn't care, there is no reason to change the address for each donation.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!