You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

5.8 KiB

layout permalink
learn /:collection/:path.html

Developer FAQs

{:.no_toc}

These FAQs are intended for developers of Blockstack.

  • TOC {:toc}

I'm a web developer. Can I build on Blockstack?

Yes! Blockstack is geared primarily towards web developers. All of your existing knowledge is immediately applicable to Blockstack. Anything you can do in a web browser, you can do in a Blockstack app.

I'm a non-web developer. Can I build on Blockstack?

Yes! Blockstack implements a RESTful API which lets you interact with Blockstack from any language and any runtime. In fact, the reference client (blockstack.js) is mainly a wrapper around these RESTful API calls, so you won't be missing much by using a language other than Javascript.

What's the difference between a web app and a Blockstack app?

Blockstack apps are built like single-page web apps--- they are, in fact, a type of web application.

Blockstack apps are a subset of web applications that use Blockstack's technology to preserve the user's control over their identities and data. As such, they tend to be simple in design and operation, since in many cases they don't have to host anything besides the application's assets.

Do I need to learn any new languages or frameworks?

No. Blockstack applications are built using existing web frameworks and programming The only new thing you need to learn is either blockstack.js or the Blockstack RESTful API.

How does my web app interact with Blockstack?

The blockstack.js library gives any web application the ability to interact with Blockstack's authentication and storage services. In addition, we supply a public RESTful API.

What does blockstack.js do?

This is the reference client implementation for Blockstack. You use it in your web app to do the following:

  • Authenticate users
  • Load and store user data
  • Read other users' public data

How do I use blockstack.js?

We have several examples you can use to get started. Please see the API documentation here.

How can I look up names and profiles?

You can use blockstack.js, or you can use the public Blockstack Core endpoint.

How can I read my public app data without blockstack.js?

The URLs to a user's public app data are in a canonical location in their profile. For example, here's how you would get public data from the Publik app, stored under the Blockstack ID ryan.id.

  1. Get the bucket URL
$ BUCKET_URL="$(curl -sL https://core.blockstack.org/v1/users/ryan.id | jq -r '."ryan.id"["profile"]["apps"]["http://publik.ykliao.com"]')"
$ echo "$BUCKET_URL"
https://gaia.blockstack.org/hub/1FrZTGQ8DM9TMPfGXtXMUvt2NNebLiSzad/
  1. Get the data
$ curl -sL "${BUCKET_URL%%/}/statuses.json"
[{"id":0,"text":"Hello, Blockstack!","created_at":1515786983492}]

How do I register Blockstack IDs?

You should use the Blockstack Browser.

How do I register Blockstack Subdomains?

You can deploy and use a [Blockstack Subdomain Registrar]({{ site.baseurl }}/core/naming/subdomains.html), or use an existing one.

Can I programmatically register Blockstack IDs?

Blockstack applications do not currently have have access to the user's wallet. Users are expected to register Blockstack IDs themselves.

However, if you feel particularly ambitious, you can do one of the following:

  • Set up a blockstack api endpoint (see the project README) and write a program to automatically register names. Also, see the API documentation for registering names on this endpoint.

  • Write a node.js program that uses blockstack.js to register names. This is currently in development.

Can I programmatically register Blockstack Subdomains?

Yes! Once you deploy your own subdomain registrar, you can have your web app send it requests to register subdomains on your Blockstack ID. You can also create a program that drives subdomain registration on your Blockstack ID.

Do you have a testnet or sandbox to experiment with Blockstack?

We have an integration test framework that provides a private Blockstack testnet. It uses bitcoin -regtest to create a private blockchain that you can interact with, without having to spend any Bitcoin or having to wait for blocks to confirm. Please see the README for details.

Does Blockstack have a smart contract system?

No, not yet. This is because Blockstack's design philosophy focuses on keeping system complexity at the "edges" of the network (e.g. clients), instead of the "core" of the network (e.g. the blockchain), in accordance with the end-to-end principle. Generally speaking, this can be interpreted as "if you can do X without a smart contract, you should do X without a smart contract." This organizing principle applies to a lot of useful decentralized applications.

Can Blockstack applications interact with Bitcoin? Ethereum? Smart contracts? Other blockchains?

Yes! Since Blockstack applications are built like web applications, all you need to do is include the relevant Javascript library into your application.