Creating a Gulden Trading app: Authorize with Nocks

My plan is to create a Gulden Trading app. At this stage I don’t know yet if i’ll have enough time for this project and whether I’ll really manage this, but in this blog I’ll guide you through my journey.

When creating an app which logs in on Nocks.com you can direct your users to do a couple of things. There’s in my opinion only one real way and that is by creating a “Personal Application” in Nocks, which then can be

The objective of this post is to show you the right direction how to authenticate against Nocks; when you have this; you can “talk” to Nocks with your website or app in any way you want.

For the sake of keeping this simple we’ll use the application “Postman” to create the requests;

First things first: You need to make the Personal Application.

  1. Go to https://www.nocks.com/account/api/personal-clients and click on the button: “Create New Application”
  2. Enter the name of your (web)Application and for redirect URL use your own Redirect URL. For this sample I’ll use the redirect URL of postman which is:  https://www.getpostman.com/oauth2/callback
  3. Now you’ll see your application in the list with a couple of important data:
    1. Client ID: In my case: “37”
    2. Secret: Well it’s secret so keep it secret: But you’ll need it later
  4. Open Postman and in the following screen enter the following data:

    1. Enter as URL: https://api.nocks.com/api/v2/user/
    2. Change the Authentication Type to “OAuth 2.0”
  5. Click the button “Get New Access Token” and enter the following data

    1. Token Name: Use the name of your application (This isn’t really important)
    2. Auth URL: This isn’t currently documented by Nocks!
      https://api.nocks.com/oauth/authorize
    3. Access Token URL:
      https://api.nocks.com/oauth/token
    4. Client ID: Enter your Client ID from the data from the Nocks page in my case: “37”
    5. Client Secret: Enter the Secret string
    6. Scope: In my example I use “user.all”; you can find all the scopes in the Nocks documentation:  https://docs.nocks.com/#scopes
    7. Grant Type: Authorization CodePlease be aware!
      Nocks uses Laravel Passport for their OAuth2 authentication. Therefore if you need any help search for that implementation. The Access Token URL and the Auth URL aren’t currently documented in the Nocks documentation, ask Nocks for help if you’re stuck.
  6. Click on the button “Request Token” – You’ll be presented the Nocks Login screen. If you have 2FA enabled you’ll also asked to enter your 2FA code.
  7. Nocks asks you if you’re willing to permit access to your Nocks account via the app you’ve just created. Click “Authorize”
  8. You will be redirected to Postman and now you’ll see a new Access Token in the list in Postman:
  9. Click the Access token and make sure the token is added to the Header and click “Use Token”
  10. Now you’re ready to get the private data with the just received access token.
    Click the button “Send” and in the bottom part of Postman you’ll see a JSON string returned with personal user information
  11. For the sake of keeping my own data safe I won’t enter a screenshot with the JSON string returned.

In the previous steps you did following:

  • Register a Nocks Application
  • Enter OAuth data for your app to receive an access token
  • Create a request with the access token so that you receive personal information.

I hope this post was helpful and you’re able to authenticate your own app against Nocks!

If this guide was helpful to you please consider a donation:

GSf4STDVNn6oacCaMbE8ag9MuQzJx13UgL

Calculate Gulden Witness yield

First of all – Pow2 isn’t released yet – So this post is hypothetical. The contents of this post will be valid once the Gulden PoW2 update rolls out and witnessing is enabled.

We get a lot of questions about how you can calculate the yield of your witness account. Basically you cannot calculate it; but there is a site which attempts to give you an estimate: https://projectify.me/witness/

To have the complete picture:

The yield of your witnessing is based on a variable witch is currently unknown AND changes every day/hour/minute That value is the “TotalNetworkWeight”
Every Witness account has a Weight – That weight can be calculated through a formula in the PoW2 Whitepaper (Page 34).
TotalNetworkWeight is the weight of all the witness accounts combined and can currently only be estimated.

When Witnessing is released TotalNetworkWeight is a value that can be retrieved from RPC (through the Gulden-app) and so that value is transparant. Thus you can calculate what your weight is compared to the total network weight. Based on that you can estimate how often your witness account is selected for witnessing and thus how often you should be able to witness. When your weight is more than 2% of the TotalNetworkWeight your weight will be reduced to 2% for the selection. If you’re account is selected to witness you’ll get in a “cool-of” period of 100 blocks.During that time you cannot witness with that specific Witness account. Based on an estimation of 576 blocks per day IF you have a super strong network weight theoretically you can only witness 5.76 times per day (or 115 Gulden per day; because each witness action gives you 20 Gulden).

Therefore I think your maximum yield is 126.144 Gulden in 3 years per witness account. And that is based on super positive values (like your account gets selected every time the first time you’re selected to witness).

I think the values on the website https://projectify.me/witness/ are WAY over-estimated and don’t represent anywhere near what’s able to witness in 3 years.

GuldenNodes.com – Help visualize all the Gulden nodes

What is cooler than knowing that Gulden is a growing network of nodes? Well seeing those nodes is way cooler than only knowing that they are there. A Slack user I’ve been chatting with, named Sebastiaan Pasma has such an overview and it looks totally great. His website GuldenNodes.com gives a visual overview of the nodes connected to each other for the Gulden Blockchain. Continue reading “GuldenNodes.com – Help visualize all the Gulden nodes”

Get started with (PHP) developing on the Gulden blockchain

The blockchain technology caught my attention a few months back when learning more about Gulden, which is a good alternative to Bitcoin. In my opinion the blockchain technology will be the next big thing in tech for the next few decades. It’s been around for almost 8 years now, and to my opinion hasn’t got enough traction it deserves. Therefore I decided I wanted to do more with this technology and learn more about it. But where to start? How to start? There’s so much to learn about the blockchain that it simply cannot be summarized in a simple blogpost like this. But this blogpost is a summary of what I’ve learned with the Gulden blockchain over the past few weeks.

Continue reading “Get started with (PHP) developing on the Gulden blockchain”