Are there any API services that allow me to send a Bitcoin transaction with OP_RETURN? - bitcoin

I want to be able to send the minimum amount of Bitcoin required in order to write a 40 byte (roughly 80 character) message via ideally a REST API allowing me to specify a bitcoin wallet private key, the recipient bitcoin address, the fee and the message to attach to the OP_RETURN.
Thank you!
--
I wish Bitcoin allowed you to send coins without having to have an API or daemon - through http somehow would be cool. How would I create a raw transaction with a OP_RETURN in it to push to an API /tx/push using php and curl?

There are more options as the OP_RETURN protocol is so simple but here are the ones I recommend:
1. Blockcypher
Blockcypher API has a Data endpoint to write op return transaction but you need to register an API token with them so it's not completely under your control (they can ban your token), it supports only 40 bytes not 80 (well 75 in reality) but it's free, which is awesome!
Check it out (mainchain):
https://www.blockcypher.com/dev/bitcoin/#data-endpoint
Example from their doc (curl):
# Embedding String Data
curl -d '{"data":"I am the walrus", "encoding":"string"}' https://api.blockcypher.com/v1/btc/main/txs/data?token=YOURTOKEN
{
"data": "I am the walrus",
"encoding": "string",
"token": "YOURTOKEN",
"hash": "cb6974e0fd57c91b70403e85ef48c840eecdca4804dfc4897b1321d5328e4f18"
}
2. BlockchainPen
If you're searching for an APP (maybe to test quickly) or to get some open source code and modify it to your needs there's BlockchainPen:
http://blockchainpen.com
This is not an API service but more a webapp. It has a client-side browser wallet where you can load some funds (1mbtc?) and write op-return messages.
Click on the address to get a QR for loading funds quickly from a mobile wallet - The UI is very basic, you need to refresh the page to see the updated balance - The funds are yours, you can export your private key at any time (check the link at the bottom of the page).
The code is open source so you could import and use the Pen class (coffeescript or js version) in your programs to write transaction via nodejs: https://github.com/makevoid/blockchain-pen/blob/master/pen.coffee
Or with something like phantomJS, selenium/webdriver or some other browser automation tool you could use the deployed version but I think it will not be clean.
There are two currently open source implementation of blockchain-pen:
1: https://github.com/makevoid/blockchain-pen (latest)
2: https://github.com/makevoid/blockchain_pen (old repo - js / ruby opal)
You can also change the fee depending on your needs, the default one is 0.1mbtc, on http://prio.blockchainpen.com (priority) is 0.3mbtc.
(p.s. disclamer: I'm the developer behind this, feel free to fork/improve the project, a new and simpler version will be released in 2017)

You can use http://www.stamping.io you can anchored a transaction in Bitcoin & Ethereum in the same time. Try it!

Related

How do I programatically download bank of America transactions?

I use quicken, which can automatically download bank of America transactions. However, it truncates all the payees so I lose data. I'd like to work around this and I'm thinking of downloading the transaction data and generating my own QFX file with the full payee info.
Is there a way that I can download transactions programmatically, or download something like a .qif (available on their website) programmatically? For the latter, I could convert the gif to a QFX myself.
If anyone has other ideas to download all of the transaction information without losing the payee info, I would welcome those ideas as well.
Do they provide an api for this? but most probably not for 3p without a contract. since its bank , there must be check for browser etc along with standard sign in so it'll hard for curl. you can have a browser plugin to read all the data from the page and do auto scroll to get new transactions if not fitting in page. it's a hacky solution but good to get what we need as you told that data is available on the page and have to revisit with updates but changes in basic structure is rare.
A quick search for bank of america api yielded this BofA API. They even have many options for types of payment information you could query here as well as lots of individual account types that you can access it as.
It looks pretty comprehensive. If you don't see what you are looking for there I put another option below, just in case.
I don't use BofA. So I can't speak to what they have natively available. But you could always use a bot to scrape it if they present it anywhere in the User Interface.
I would agree with Meena that you should not be able to use curl. But selenium uses a browser to programmatically do just about anything that you would want to do with any website. They also have bindings for many languages. So you could just pick your favorite and go to town...
It seems the API will return a JSON so you may need to find a tool to convert that to a qif or qfx if that part is important. After digging further, I can't test this without having a CashPro account but it seems what you need to do is...
Step 1:
Get an access token from here. You'll need to send this in the header of any requests
Step 2:
Send an http request with a header in the following format:
{
"accounts": [
{
"accountNumber": "xxxxxxx",
"bankId": "xxxxxxx"
}
],
"fromDate": "yyyy-mm-dd",
"toDate": "yyyy-mm-dd"
}
to https://developer.bankofamerica.com/cashpro/reporting/v1/transaction-inquiries/previous-day
Step 3:
You should get a JSON as a response
As mentioned, I can't test this but here's the documentation of the specific API endpoint you need

iTune Connect: Export Compliance [duplicate]

I making a new app and want to submit to app store.
But at the time of final submission
there is check for Export Compliance.
What should I Check Yes Or No.
I use https url in my app.
Please Help Me .
Thanks In Advance.
When you know that you ARE export compliant you can put this in your Info.plist:
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
This will prevent App Store Connect from asking you questions about export compliance.
If you are using https in your application, you will need to answer yes to this question, even if all you are using is built in mechanisms to communicate over https. The good news is that you no longer need to get the Encryption Registration Number (ERN) - the current requirements (as of August 2017) are that you just need to submit the annual self classification report to the BIS(Bureau of Industry and Security). To submit a self classification report, follow the instructions on item 13 in this FAQ: A sample Self Classification report can be found here.
For a great write up that talks about both sides of the story (apps that only use common / freely available encryption, like SSL, as well as apps that have their own, proprietary encryption, see this Medium post.
Please don't listen to other people who state that they just answer no to this question to make things easier when submitting an app.
As of February 2018 this is the process to file an Annual Self Classification Report to BIS (Bureau of Industry and Security):
https://www.bis.doc.gov/index.php/policy-guidance/product-guidance/high-performance-computers/223-new-encryption/1238-how-to-file-an-annual-self-classification-report
To get a ECCN (Export Control Classification Number) for a HTTPS mass market iOS app follow, these steps.
Download the quick reference guide to classify your app.
https://www.bis.doc.gov/index.php/documents/new-encryption/1652-cat-5-part-2-quick-reference-guide/file
For a basic HTTPS iOS app used to securely access a webpage or transfer a file use
5D992 which is Information Security” “software” not controlled by 5D002.
If your app contains more encryption functionality, then reference the policy guide. https://www.bis.doc.gov/index.php/policy-guidance/encryption
Might not be what you want to hear, but you will need to review the policy and correctly categorize the app and get the correct ECCN.
Now go to the SNAP-R form. https://snapr.bis.doc.gov/snapr/
To get to the form from the BIS homepage.
https://www.bis.doc.gov/index.php
Then select Licensing -> Simplified Network Application Process Redesign (SNAP-R)
Register Online for a SNAP-R account.
https://snapr.bis.doc.gov/registration/Register.do
The Bureau of Industy and Security will return a CIN application ID quickly via email.
Return to the main SNAP-R page with the CIN issued number and login.
Select "Create Work Item "
The Type will be "Commodity Classification Request"
Reference number is 7 digits. I used my phone number.
Create
Fill in Contact Information.
Leave License Information Blank
Fill in Company Designation any info missing. When you created the CIN this info was requested.
Other Party can be left blank.
Now for each app you want to register, fill in a Export Item and press Add Export Item. Multiple apps can be submitted on the same request.
ECCN will be 5D992
APP can be left blank. It is the Adjusted Peak Performance"("APP") which for a commodity iOS app is not required.
Product/Model is the name of the app in the App Store.
CCATS can be left blank.
Manufacturer is your company name.
Technical Description - briefly describe the apps function and how HTTPS is leverage. Keep it simple. They are interested if the app is a security risk and how encryption is used.
example:
AppName is distributed as an Apple iOS App. It uses HTTPS to download/upload daily updates to and from xxxx. The download is used to generate a table. An In-App .99 cent purchase expands the table results to include xxxx.
Additional information explains in more detail how HTTPS has been implemented.
The HTTPS file transfer is a URLSession data transfer task found in the Apple Foundation library. The iPhone automatically performs the download of the published data in csv file format, using the HTTPS protocol for a secure transfer.
Make sure you saved all your drafts. Check for errors. Then submit.
The turnaround is pretty fast. Mine took around an hour. But I am sure it varies.
The other option is once a year you can submit an Annual Self Classification Report. But if you have a SNAP-R CCATS number you are not required to submit a Annual Self Classification Report.
https://www.bis.doc.gov/index.php/policy-guidance/encryption/4-reports-and-reviews/a-annual-self-classification
This is very simple. Download the sample csv file. Delete out the sample data leaving the headings. The heading are required. Fill in the columns. The column Authorization Type is MMKT. Item type Other: HTTPS File Transfer. Save the file and submit.
The BIS SNAP-R hotline [202-482-4811 DC, 949-660-0144 CA] and the Encryption Hotline for the annual submission [202-482-0707] are both very helpful. Last point, the BIS has helpful set of YouTube video.
https://www.bis.doc.gov/index.php/online-training-room
Hope this helps.
From Complying with Encryption Export Regulations: Declare Your App’s Use of Encryption:
Typically, the use of encryption that’s built into the operating system—for example, when your app makes HTTPS connections using URLSession—is exempt from export documentation upload requirements, whereas the use of proprietary encryption is not. To determine whether your use of encryption is considered exempt, see Determine your export compliance requirements.
So Apple says that for usual HTTPS scenarios, you do not need to upload export documentation for your app.

How to check Bitcoin address balance from my application?

How do I check a balance of a Bitcoin address (any, not necessarily mine), let's say in a Java application (or any other language)?
I need a functionality like the one on blockchain.info or biteasy.com but I don't want to use their API. Bitcoin is open source, so I thought maybe it won't be so difficult to get the data myself?
For now there is no simple way to get balance of a address that not in the wallet with bitcoin core. Maybe this function is under developing.
To get a address's balance, you need to compute the utxos on the address from the whole block chain. (I guess fornow there maybe no record of balance on each address, so you've to calculate it form the whole block chain)
You said in your question, you didn't want to use third site's API
(For example https://api.blockcypher.com/v1/btc/main/addrs/38DGj87axzmQiZeAd1w1y5FEmuu5a7pfBa).
You can run a bitcoin browser in you device, for example bitcoin explorer
Use blockexplorer.com model and piggy back off their server or run your own using open source version at github.com/lirazsiri/blockexplorer
It is not necessary to use web wallets to create addresses. You can install your own bitcoin server/daemon and act like your own bank.
This is the place to start if you want to know how to do it (https://en.bitcoin.it/wiki/Main_Page).
Bitcoin can be queried using JSON RPC methods. So if you are running a bitcoin daemon locally you can just query them. The documentation for the same is located at
Running Bitcoin - https://en.bitcoin.it/wiki/Running_Bitcoin
API Reference - https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)
API Call List - https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list
Hope this helps.
You can use JSON-RPC method. bitcoind widely supports JSON-RPC calls. So just go to the official website of bitcoin and find all of the methods.
Here is an example in PHP. Just include the jsonClient.php file
<\?php
require_once jsonRPCClient.php'; <br />
$bitcoin = 'https://' . $rpcusername . ':' . $rpcpassword .
'#' . $rpcip . ':' . $rpcport . '/'; <br />
print_r($bitcoin->getnewaddress());
?>

bloomberg api server?

looking at bloomberg api
http://www.openbloomberg.com/
and downloaded example code, looks we need some server to get the data?
private void run(String[] args) throws Exception
{
String serverHost = "127.0.0.1";
int serverPort = 8194;
String serviceName = "//blp/mktdata";
SessionOptions sessionOptions = new SessionOptions();
sessionOptions.setServerHost(serverHost);
sessionOptions.setServerPort(serverPort);
are the servers freely available or we need to buy that?
if not, this means we still do not have a open free data (either live or historical?)
thx.
127.0.0.1" is your local machine and you need to have a Bloomberg terminal open & logged on (=> you need to be a subscriber, which is chargeable).
The only thing that is "free" is the API, which has been open sourced. But the data remains proprietary, whether it's live or historical.
There's relevant information in this SO post. Specifically user2023861 offers a project Bloomberg API Emulator which you might find useful. I haven't tried it. Bloomberg, in response to a question sent to open-tech#bloomberg.net, has announced a plan to release their own emulator later this month. The intention to do this is mentioned here in the response to question 7.
You can access some data from the bloomberg website, e.g. historical data on investment funds. It's not an officially released API so my change in the future, but for now it's working. Here you can find a simple example to download yearly time series.

REST API for driving distance?

Is there a service that will give me the driving distance between two addresses? Apparently Google Maps API requires you to display a map, which I don't want to do (on that particular page), and I'd like to just snag the data and save it to my DB after a user submits a form, rather than waiting for JS to do it's thing.
If it's relevant, this is going into a Django app. I discovered that CloudMade offers a Python API, which is nice, except their latest dev release has a bug in it (can't use the API object), but more importantly, it's support for Canada is awful (couldn't find directions from any major city around here!).
MapQuest's Directions API is HTTP Querystring based (I'm not sure if it's entirely RESTful). Can get XML or JSON response. Just need to send it an HTTP GET Request.
http://developer.mapquest.com/web/products/open/directions-service
Use the "distance" response parameter.
I don't have a high enough reputation on SO to comment on an answer but I just wanted to be clear that contrary to the voted correct answer, Google Directions API has to adhere to the Google Maps API. If you scroll down the supplied link, you will see:
Note: the Directions API may only be used in conjunction with displaying results on a Google map; using Directions data without displaying a map for which directions data was requested is prohibited. Additionally, calculation of directions generates copyrights and warnings which must be displayed to the user in some fashion. For complete details on allowed usage, consult the Maps API Terms of Service License Restrictions.
Would it be possible to use Google Maps GDirections object? This can return the textual directions instead of the map overlay if called with a div object. From there you can use the getDistance (or getDuration) functions. You can always use an invisible div for the returns if you don't want anything to be displayed on the page.
Start here
http://code.google.com/apis/maps/documentation/examples/directions-advanced.html
http://code.google.com/apis/maps/documentation/reference.html#GDirections
And use this sample code
var map;
var directionsPanel;
var directions;
function initialize() {
directionsPanel = document.getElementById("route");
directions = new GDirections(null, directionsPanel);
GEvent.addListener(directions , "load", onGDirectionsLoad);
directions.load("from: 500 Memorial Drive, Cambridge, MA to: 4 Yawkey Way, Boston, MA 02215 (Fenway Park)");
}
function onGDirectionsLoad(){
alert(directions.getDistance().html);
}
Here is my solution:
Signup for Mapquest Developer network.
Get AppId
Open your command shell and run the following command(or use fiddler) But running it through curl will give you flexibility to automate your request
curl -X POST -H "Content-Type: application/json" -d '{locations: ["Salt Lake City, UT","Ogden, UT",],options: {allToAll: false}}' http://www.mapquestapi.com/directions/v2/routematrix?key=YOURKEYGOESHERE >> distance.txt
Save above command with all your destinations into batch or sh file.
Now grep and parse out your distance.txt file for what you need.
There are free services out there, but the quality of the data may be questionable/non-existent in areas. Be aware of licences on the data too, storing in your own DB may be a breach.
http://openrouteservice.org/
Take a look at Navteq. I used their service in developing a driving directions application about 5 years ago, and got good results. Can't speak for them lately though. I believe the best URL is Navteq Routing Service
You can use the new Google Directions API directly, without using any javascript.
http://code.google.com/apis/maps/documentation/directions/