If you are new to crypto, you may have heard the terms coins and tokens. You might wonder if they are the same? The simple answer is they are not the same or interchangeable.
Coins and tokens both represent a store of value. This is similar to fiat currencies like the United States Dollar. Crypto coins are a form of money, while tokens represent something that can be assigned a price.
Technically all coins are considered tokens but not all tokens are considered coins. Confused? Here are the differences:
Blockchain is an extremely hot topic nowadays: you'll see articles describing this phenomenon in almost every newspaper and magazine, even where you would hardly expect it to see. Even if you haven't read about Blockchain in your favorite newspaper or magazine, chances are you have heard Elon Musk tweeting about it.
Cryptocurrencies like Bitcoin and Ethereum are powered by a technology called the blockchain. At its most basic, a blockchain is a list of transactions that anyone can view and verify. The Bitcoin blockchain, for example, contains a record of every time someone sent or received bitcoin.
In the previous article, I showed you how to use the Coinbase API to authenticate your application so that anybody can use it. In this article, I will show you how to build on this by
- getting user details
- getting a list of all user accounts
- get a list of all transactions (buy, sell, etc) that the user has completed for each crypto coins they own.
Getting User Details
Let's look at the Coinbase API documentation on about showing the current user details. You can view documentation here.
The documentation says we need to make a
GET call to the
/v2/user endpoint to get current user's public information. To get user's email or private information, use permissions
Coinbase is a cryptocurrency exchange where you can buy popular coins like Bitcoin and Ethereum. In these series of articles I will show you how to utilize the Coinbase API to see a list of cryptos that you hold as well as all the transactions for a specific crypto coin. We will be creating a Node.js application to access the Coinbase API.
Coinbase API Options
You can access the Coinbase API here. Coinbase has two types of APIs
The API Key is used to access your account on Coinbase. The OAuth2 API is used to authenticate to coinbase for any user and then have access to all the API functionality.
For this demo, I want to make this available to everyone to use not just myself so we are going to use the OAuth2 API.
Every application has data. Let me show you how to store your data in a MongoDB database from an app written with Node.js and Express.js.
What is CRUD
CRUD is an acronym for Create, Read, Update and Delete. CRUD is the operations that you use to:
- create data in a database
- read the data in a database
- update the data in a database
- delete the data in a database
What we will be creating
We will create a simple application where you can store a user's first and last name in a MongoDB database. Here is what it looks like: