<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Pawel K on Medium]]></title>
        <description><![CDATA[Stories by Pawel K on Medium]]></description>
        <link>https://medium.com/@pawk?source=rss-45571d08a21------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*p8B6q5bdAMIXLsqaqV9tDA.jpeg</url>
            <title>Stories by Pawel K on Medium</title>
            <link>https://medium.com/@pawk?source=rss-45571d08a21------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 20:27:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pawk/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to start with ADP integration]]></title>
            <link>https://medium.com/@pawk/how-to-start-with-adp-integration-ebcb38877f99?source=rss-45571d08a21------2</link>
            <guid isPermaLink="false">https://medium.com/p/ebcb38877f99</guid>
            <category><![CDATA[oauth]]></category>
            <category><![CDATA[integration]]></category>
            <category><![CDATA[oauth2]]></category>
            <category><![CDATA[pda]]></category>
            <dc:creator><![CDATA[Pawel K]]></dc:creator>
            <pubDate>Thu, 30 Apr 2020 08:22:51 GMT</pubDate>
            <atom:updated>2020-04-30T14:39:57.694Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7wN5t9ILU0fpnhbMX2vtng.jpeg" /></figure><p>So you got in touch with ADP people and they have sent you the <strong>ADP Marketplace Partner Credentials </strong>document. This document, as the rest of ADP documentation, is a little bit overwhelming with the amount of information it carries. This article aims to ease this cognitive effort and help you with understanding the overall workflow as well as how the actual integration will work when implemented.</p><p>TL;DR</p><p>To get hold of the organization data that is subscribed to your ADP app, you need to:</p><p>1. use your OAuth2 partner credentials to obtain the partner access token,</p><p>2. with this access token, you need to request for OAuth2 client/consumer credentials,</p><p>3. with client credentials, you’d get the client access token specifically for the organization you want to access on ADP side.</p><h3>What the document is all about?</h3><p>There are two main things ADP onboarding document carries:</p><ol><li>three different sets of credentials + other access info, allowing you to develop your integration using ADP sandbox environment,</li><li>rather vague description of how you can access ADP services.</li></ol><p>One thing that made my mind blown away was lack of foreword and a high level description of the process. Why I need this document? How should I start? Do I need to do anything before I can access organization data within ADP?</p><h3>The Big Picture</h3><p>We have a organization registered within our system. Now, we would like to offer integration between the system and ADP — so we could sync employees, do payroll, basically leverage any functionality that ADP offers.</p><p>To achieve that, we need the ADP marketplace application. This is kind of an entry point for our services into ADP APIs. Whenever you want to grab something from ADP APIs, you need to go through ADP Marketplace and first implement your ADP marketplace application.</p><p>When your ADP application is live in the ADP Marketplace, then ADP users are able to subscribe to it (by buying the app subscription), allowing your system to grab the data related to their ADP organisations. From this moment you can use ADP APIs on behalf of the org that subscribed to you application.</p><p>To get to this point, first you need to do two other things:</p><ol><li>integrate with ADP Marketplace subscription mechanisms,</li><li>integrate with ADP SSO service.</li></ol><p>This article (as well as ADP onboarding document) assumes you got those two things sorted out (by providing you pre-subscribed organization and other things which are set up for you) and explains how to approach the very consumption of ADP Data APIs. This is just to give you the idea of how you would access APIs.</p><h3>How to create your own ADP app?</h3><p>To do this, we would create the App Listing while being logged into ADP Marketplace using your <strong>Developer Credentials</strong>. You won’t find these within <strong>ADP Marketplace Partner Credentials</strong> document, they would rather be delivered to you with email titled ADP Generated Message: <strong>Enrolling for ADP Marketplace</strong>.</p><p>The process of the App Listing creation is described within the document, but you wouldn’t actually interact with the app just yet, this will be a part of the first step of your integration, which would be Marketplace integration.</p><h3><strong>How to use the document?</strong></h3><p>The <strong>ADP Marketplace Partner Credentials</strong> document’s purpose is to demo you how the integration would work when implemented. I had some difficulties myself to understand it fully, so I scripted it out a bit. You can find the code <a href="https://github.com/pawk/how-to-start-with-adp-integration">here</a>. We will be using those scripts to understand the flow.</p><h4>Three sets of credentials</h4><p>There are three different sets of credentials in the document.</p><ol><li>Partner Credentials for Marketplace,</li><li>Partner Credentials for Single Sign-On,</li><li>Partner Credentials for Data Connector.</li></ol><p>Huh, that’s a lot! All three credentials have its purpose and all use different authorization standards. Let’s briefly go through them one by one.</p><h4>Partner Credentials for Marketplace</h4><p>As you already know, you need to start your integration with a creation of your new shiny ADP Marketplace application. These credentials would allow you to authorize against ADP Marketplace using OAuth1 authorization standard.</p><p>Funny thing is, I have never used them. When you create you App Listing you will get the proper ones generated for your app as described in the document. Don’t worry about it for now, we can cover how to speak with ADP Marketplace using OAuth1 in another article.</p><h4><strong>Partner Credentials for Single Sign-On</strong></h4><p>When you already have Marketplace integration in place, that means ADP users are able to subscribe to it and allow your system to access ADP APIs on his behalf. To make it easier for him to move about between ADP and your service, you are requested to implement SSO.</p><p>The standard used for SSO is OpenID Connect. Implementing it is Step 2 of your integration.</p><h4>Partner Credentials for Data Connector</h4><p>This is something we were wanting to use in the first place! Those creds are giving us access to the ADP data APIs we can consume in behalf of the subscriber.</p><p>Although this is kind of the last stage you’d normally approach during the implementation process, ADP folks decided it’s a good idea to vaguely describe the process in the document, which description I personally find insufficient to say at least and which I’ll try to explain below.</p><h3>THE MEAT!</h3><p>So there’s a user who subscribes his organization to your app. This process can differ in details depends how you sort this out with the ADP sales team. The important thing is, you already have one org pre-subscribed to your application, given to you for testing purposes. This org is identified by <strong>organizationOID</strong> parameter which you can find in the document (search for “Sandbox OrganizationOID”). Having this subscription in place means you can start to play with ADP APIs.</p><p>Normally, right after the subscription, the user who initiated the process would be additionally asked to provide the consent so your system could grab his credentials and use them for talk to ADP APIs on his behalf.</p><p>Grab his credentials? Yes! To query the API in behalf of the organization, you first need to use your <strong>Partner Credentials for Data Connector </strong>to fetch the <strong>organization credentials</strong> and then use those to talk to ADP APIs.</p><p>This sounds complicated but it’s not, really. I’ll try to kind-of visualise things with some scripts.</p><h3>You need a cert first!</h3><p>Although there are some dead simple curl examples on ADP APIs reference website that don&#39;t include cert stuff and any authorization header (and which do work, oddly), they don’t show how the actual request should be made and there’s one crucial element missing in those examples: mutual ssl certificate.</p><p>You can obtain it by issuing <strong>Certificate Signing Request </strong>— log in to Marketplace (with your <strong>Developer Credentials</strong>), find <strong>Certificate Signing Request</strong> app, subscribe to it, click on it and follow instructions.</p><p>In the result of this process you will get your private key (presented to you while issuing CSR) and the signed certificate (sent to you by email). This certificate needs to be used with every API request.</p><p><strong>**NOTE**</strong> for this demo purposes, within the email received from ADP there are different types of certs, you should download and use `<strong>Certificate (w/ chain), PEM encoded</strong>` one.</p><h4>Clone the repo</h4><p>I created some ready-made scripts to help you understanding the flow, you can clone it from <a href="https://github.com/pawk/how-to-consume-adp-apis">here</a>. There’s a set of bash scripts we will be using, you should inspect them to see what is the structure of requests issued.</p><h4>Set up the environment</h4><p>Let’s set up some environment variables that will be used by our Bash scripts.</p><pre># obtained from Certificate Signing Request process<br>export ADP_CERT_PATH=/path/to/pem/encoded/cert/file<br>export ADP_KEY_PATH=/path/to/private/key/file<br># defined in ADP onboarding document as “Partner Credentials for Data Connector”<br>export ADP_PARTNER_CLIENT_ID=aaaaaaaa-48d0-dddd-cccc-3b12999934cd<br>export ADP_PARTNER_CLIENT_SECRET=bbbbbbbb-e912-dddd-aaaa-9799999c219c<br># defined in ADP onboarding document as “Sandbox OrganizationOID”<br>export ADP_SANDBOX_ORGANIZATION_OID=G3DXXXX1XXX1BQRD</pre><h4>Obtaining Partner access token with Partner Credentials</h4><p>When you have the prerequisites set up correctly, now you can obtain your Partner access token to be used for API calls. This will use OAuth2 Client Credentials Grant with Basic Authorization.</p><pre>export ADP_ACCESS_TOKEN=$(bash/oauth/token)<br>echo $ADP_ACCESS_TOKEN</pre><p>Let’s look into the script to know what’s going on there</p><pre># ... there are few other lines here, but the crucial part is</pre><pre>curl -X POST -s \<br># we&#39;re doing basic auth here, curl will build `Authorization: Basic base64(user:pass)` header for us<br>-u ${1:-$ADP_PARTNER_CLIENT_ID}:${2:-$ADP_PARTNER_CLIENT_SECRET} \<br># we need to use the cert obtained from ADP<br>--cert &quot;$ADP_CERT_PATH&quot; \<br># we need the key along with the cert<br>--key &quot;$ADP_KEY_PATH&quot; \<br># this executes OAuth2 Client Credentials Grant<br>https://accounts.adp.com/auth/oauth/v2/token?grant_type=client_credentials \<br># let&#39;s grep out the access token<br>| grep access_token | sed &#39;s/.*access_token&quot;:&quot;\(.*\)&quot;,/\1/&#39;</pre><p>This will return access token and assign it to bash variable; complete curl payload would look something like this</p><pre>{<br>  “access_token”:”91a260c2-bbbb-aaaa-cccc-bdbce5b5ab22&quot;,<br>  “token_type”:”Bearer”,<br>  “expires_in”:3600,<br>  “scope”:”api”<br>}</pre><p>This access token is for the Partner APIs only so it won’t allow you to fetch any data related to the organization subscribed to your app. To do this, you will need this organization’s credentials, which in turns you’ll need to use to obtain client’s OAuth2 access token (just like you did with Partner OAuth2 access token above).</p><h4>Obtaining Client access token with Client Credentials</h4><p>To be able to fetch client credentials, you need to provide the consent with <strong>Data Connector Consent Manager </strong>link (see ADP onboarding pdf). I mentioned before this would be one of the steps you’d normally follow when subscribing to ADP app, but as long as sandboxed organization is already subscribed to your app, this needs to be done “manually”. Consult with your PDF how to do this.</p><p>To fetch client credentials you need to use partner access token obtained in the previous step along with <strong>subscriptionOrganizationOID</strong> (sandboxed organization identifier, which is subscribed to your app).</p><pre>bash/client-credentials/read $ADP_ACCESS_TOKEN</pre><p>This will return just the credentials from the received payload. Full curl response will look something like this</p><pre>{<br>  &quot;events&quot;:[<br>    {<br>       &quot;eventID&quot;:&quot;9292be53-cdcd-4c90-8c33-e45b3d66a04c&quot;,<br>       &quot;eventNameCode&quot;:{<br>         &quot;codeValue&quot;:&quot;consumer-application-subscription-credentials.read&quot;<br>       },<br>       &quot;effectiveDateTime&quot;:&quot;2020-02-20T12:24:40.933Z&quot;,<br>       &quot;creationDateTime&quot;:&quot;2020-02-20T12:24:40.933Z&quot;,<br>       &quot;recordDateTime&quot;:&quot;2020-02-20T12:24:40.933Z&quot;,<br>       &quot;data&quot;:{<br>         &quot;output&quot;:{<br>           &quot;consumerApplicationSubscriptionCredentials&quot;:[<br>             {<br>               <strong>&quot;clientSecret&quot;:&quot;367fdddd-bbbb-4784-b2a0-aaaa4d29bb&quot;,<br>               &quot;clientID&quot;:&quot;0d05cccc-eeee-4f2c-a12e-ffff829cffff&quot;,<br>               &quot;subscriberOrganizationOID&quot;:&quot;G3DXXXX1XXX1BQRD&quot;</strong><br>             }<br>           ]<br>         }<br>       },<br>       &quot;eventStatusCode&quot;:{<br>         &quot;codeValue&quot;:&quot;complete&quot;,<br>         &quot;shortName&quot;:&quot;Complete&quot;<br>       },<br>       &quot;serviceCategoryCode&quot;:{<br>         &quot;codeValue&quot;:&quot;hr&quot;<br>       },<br>       &quot;actor&quot;:{<br>         &quot;associateOID&quot;:&quot;DDD4P1AQBSXXXX9D&quot;<br>       },<br>       &quot;originator&quot;:{<br>         &quot;associateOID&quot;:&quot;DDD4P1AQBSXXXX9D&quot;<br>       }<br>     }<br>   ]<br> }</pre><p>What we are after is the <strong>consumerApplicationSubscriptionCredentials</strong> section.</p><p>This is how the script looks like</p><pre># bash/client-credentials/read</pre><pre>curl -X POST -s \<br>--cert &quot;$ADP_CERT_PATH&quot; \<br>--key &quot;$ADP_KEY_PATH&quot; \<br># this header is expected by ADP as long as we are sending json payload<br>-H &quot;Content-Type: application/json&quot; \# we want response to be json as well, ADP will send xml by default<br>-H &quot;Accept: application/json&quot; \<br># using OAuth access token with Bearer authorization type<br>-H &quot;Authorization: Bearer $1&quot; \<br># I THINK you need this only for the sandbox ;) though it won&#39;t work without it<br>-H &#39;roleCode: practitioner&#39; \<br># not at all complicated payload allowing us to grab client creds<br>-d &quot;{\&quot;events\&quot;:[{\&quot;serviceCategoryCode\&quot;:{\&quot;codeValue\&quot;:\&quot;core\&quot;},\&quot;eventNameCode\&quot;:{\&quot;codeValue\&quot;:\&quot;consumer-application-subscription-credential.read\&quot;}, \<br>\&quot;data\&quot;: { \<br>\&quot;transform\&quot;: { \<br>\&quot;queryParameter\&quot;: \&quot;\$filter=subscriberOrganizationOID eq &#39;${2:-$ADP_SANDBOX_ORGANIZATION_OID}&#39;\&quot; \<br>} \<br>}}]}&quot; \<br>https://api.adp.com/events/core/v1/consumer-application-subscription-credentials.read \<br># sed the important stuff out of the response<br>| sed &#39;s/.*consumerApplicationSubscriptionCredentials&quot;:\[\([^]]*\)\].*/\1/&#39;</pre><h4>Obtaining access token with client credentials</h4><p>Now we need another access token so we could fetch stuff in client context — or rather in the context of specific consumer application subscription.</p><p>bash/oauth/token will use Partner credentials by default. In this case we are passing consumer credentials we just got in the last step.</p><pre>export ADP_SUBSCRIPTION_ACCESS_TOKEN=$(bash/oauth/token &lt;clientID&gt; &lt;clientSecret&gt;)<br>echo $ADP_SUBSCRIPTION_ACCESS_TOKEN</pre><h4>Fetching subscribed organization data</h4><p>Finally! with this access token we can do stuff using ADP Data APIs! As an example, you can fetch workers information with</p><pre>bash/workers/get $ADP_SUBSCRIPTION_ACCESS_TOKEN</pre><h3>That’s all folks!</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ebcb38877f99" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why you should study for a cloud certification]]></title>
            <link>https://medium.com/intive-developers/why-you-should-study-for-a-cloud-certification-8e2f5ac98cf9?source=rss-45571d08a21------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e2f5ac98cf9</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[certification]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Pawel K]]></dc:creator>
            <pubDate>Sun, 07 Oct 2018 17:13:56 GMT</pubDate>
            <atom:updated>2018-10-16T10:51:18.255Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6ezOIVDgj_MdFA8mivyfzw.jpeg" /></figure><p>Some of my teammates say learning for the single cloud makes no sense. It means that you are tied to that single provider. You are using provider-specific services and solutions and what if it disappears and you are left with nothing? Or what if the said provider will be uncovered as an evil organisation that kills little dolphins for a living and your conscience will not let you stay with them? All that means you would have to start all over again — another provider, yet another learning curve. And I couldn’t agree more.</p><p>So maybe you should start learning how to achieve scalability, durability and resilience on the low level, spinning up your own hardware machines, maintaining them, then Kuberneting the sh*t out of them. That would work.</p><p>Except it wouldn’t. If you’d achieve that level of desperation and go the windy and dark path of how things were made in the Middle Ages, it would take time. It would make you suffer, put you through a couple of deep depressions. Inevitably you would make a lot of mistakes, learn all the things hard way, spend a lot of money, neglect your family and friends. And then, when your children would already be 35-year-old strangers, then you’d be ready to start building some software on your beautiful, already outdated infrastructure! Your client is long gone bankrupt and you’ve wasted your life on reinventing the wheel.</p><p><strong>Nowadays</strong></p><p>Everything has changed. Cloud is a sign of times. You can’t avoid it if you want to be competitive. Just because everyone uses it, you have to do it as well. You can think it sucks but it doesn’t change anything. Why people use this devil invention, you ask? Because it makes them go a lot faster. This actually was one of the things that enabled the growth of so-called startups. I have an idea — BOOM! it’s online. It signs perfectly into Agile (or some would argue Lean) way of thinking. You need to deliver fast and you have the opportunity to deliver enterprise-grade infrastructure solutions faster than ever. You can then focus on the things that matter most (not in life, but in your job) — the software.</p><p>I mean — come on! Simple networking — with a few clicks you can have a bunch of private subnets scattered in different availability zones — no traffic comes in (because hello! no internet gateway with route table!) and guaranteed high availability (as availability zones are physically separated from one another). Of course, you also get network access control lists out of the box. So you clicked a bunch of buttons an orchestrate through a number of OSI layers — and this is only networking basics example. Imagine how long it would take you to achieve the similar result by building it yourself (not even mentioning the costs). It would take long enough to modify the design as well. With a cloud, it takes you a few minutes tops — and its free (AWS subnets I mean). A bonus in addition to a multitude of different services waiting for you to reach out for them.</p><p>With a cloud, you are empowered to provision literally any architecture at almost any scale. It will cost you of course, like with any real-life service. But not any real-life service gives you free tier you can play around — there is no free tier for my housekeeping service, sadly. With this Cloud-based free tier, you can actually run a small up to middle-sized application (almost) for free. Do you know any traditional hosting provider that will do that for you?</p><p><strong>Is this knowledge really that specific?</strong></p><p>Clouds are alike. Really. Different companies try to outrun the competitors by introducing more and more complete and sophisticated services. Then the rest of big cloud providers fills up the gap and goes an extra mile with another brilliant solution. And all of that is for your benefit (and their as well, of course). All of the cloud providers allow you to create VPCs, subnets, orchestrate networking, run compute instances, set up databases, configure failover techniques, run code as stand-alone functions, and much much more. Most of the services are managed by the provider so you don’t have to worry about maintenance, scalability issues, low-level infrastructure security — besides simple configuration the rest is taken off your shoulders.</p><p>If different cloud solutions are similar to each other, doesn’t that mean that, in a very generalised sense, they differ just by some implementational details? It’s a little bit like with two programming languages — they do have different syntax and a bit different functionality, but the basic building blocks are pretty much the same. In the end, all boils down to some servers in a network running some software. What’s more to it than that? Single services offered by providers seem to be more like abstract implementations of well-known ideas and patterns. So you just know how they work, really. You just have to use the right API.</p><p><strong>What are the alternatives?</strong></p><p>What are the alternatives you might ask? You can use standard hosting services and orchestrate rest of the solution by yourself, or go to some company that specialises in it. This is what the cloud companies are all about — they are like your local infrastructure provider (like there’s always one) but operate globally. Which also means that you can operate globally on top of the services made to your disposal.</p><p>You can of course work on abstracting things and make bootstrapping of your infrastructure platform-agnostic. Things like Terraform and Serverless will help you with that. But those are still just a kind of universal adapters with its own limits. Useful, but it’s still worth to know how they operate under the hood.</p><p>You can also learn about all the cloud solutions available — and that would probably be the best thing to do. Problem is, there are a few of those on the market. That means there is a lot to digest. But it’s still much easier than learning the low-level stuff. Then it would be advisable to know a few solutions, but I feel pretty confident you can stick with your preferred one — at least for some time.</p><p><strong>What’s next?</strong></p><p>So yes, tomorrow I’m about to get certified as an AWS Architect. The learning path provided me with a lot of knowledge and also explained some misconceptions I had on how some things work under the hood or can work when allowed to communicate with each other. With the cloud, like with programming languages, you always have to start with the first one. Then it gets easier over time. My strategy is to also get certified for one other platform because it’s important for me to have a thorough understanding of the differences between them as well as to stay competitive. This kind of knowledge is still rather seldom, especially on the professional level. There’s also that feeling that you are no more “just” a software engineer — suddenly you have those superpowers which let you create virtually anything — with just a few clicks. Well, actually you should avoid clicking as much as possible and preferably go for native infrastructure-as-code solution. But you see my point.</p><p>Happy learning!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e2f5ac98cf9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/intive-developers/why-you-should-study-for-a-cloud-certification-8e2f5ac98cf9">Why you should study for a cloud certification</a> was originally published in <a href="https://medium.com/intive-developers">intive Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The blockchain you already know]]></title>
            <link>https://medium.com/intive-developers/the-blockchain-you-already-know-dc685a68c4bb?source=rss-45571d08a21------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc685a68c4bb</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Pawel K]]></dc:creator>
            <pubDate>Thu, 09 Aug 2018 17:02:58 GMT</pubDate>
            <atom:updated>2018-08-14T08:02:49.816Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RqNn79mWnBVaSib4dIp6hA.png" /></figure><p>When we think of blockchain, we usually think — Bitcoin. But Bitcoin is just a concept on top of something called blockchain. Blockchain is the name of the underlying technology which allows for the implementation of many different use cases that can rely on blockchain properties.</p><p>For the purpose of this article, let us adopt Bitcoin as our model implementation of blockchain.</p><p>This article presents a straightforward analogy easy to follow by software developers. The reason it is quite handy for us is simply because we use it on the daily basis — or at least we should. To get to the point, the said blockchain analogy is <strong>git</strong>.</p><p>Or is it just an analogy?</p><p>When you look into the mechanics of the blockchain technology and git implementation, the similarities are staggering. Clearly, Satoshi Nakamoto had his inspirations! Remember, git is about 4 years older than Satoshi’s white paper.</p><p>Admittedly, publications on how to cryptographically secure a chain of blocks appeared even earlier (described in 1991 by Stuart Haber and W. Scott Stornetta; 1992, Bayer, Haber and Stornetta — according to Wikipedia), but those where just theoretical guidelines of how to make a chain of blocks immune to changes.</p><h4>The Definition</h4><p>Let us look at the core part of the blockchain definition from Wikipedia:</p><blockquote>A blockchain is a decentralised, distributed and public digital ledger that is used to record transactions across many computers so that the record cannot be altered retroactively without the alteration of all subsequent blocks and the consensus of the network.</blockquote><p>Does it remind you of something you all have on your computers? What else is git if not a decentralised and distributed ledger (all of your team mates have your repository’s clone on their computers)? Definition does say that the ledger should be public. Git usually requires some kind of authentication mechanism, but a basic git network protocol has absolutely no authentication whatsoever! So it is by definition a public ledger, with an option of an additional security layer.</p><h4>Blockchain is about recording data</h4><p>Blockchain’s core responsibility is to keep a record of blocks in a way that it resists modification. This is possible due to the fact that the blocks are linked using cryptography. Blocks act as containers for abstractly defined “transactions”. A transaction can be anything — it can be a record of currency transfers, or any other kind of data. This data can be materialised as current state of files in working directory. This is what git holds — a chain of blocks (commits) of multiple transactions (current files’ state).</p><p>It’s worth noting, that git does not keep the changes (diffs) between two states as it is widely believed by regular git users. It does however keep the current “state of the system” (state of the working directory) in each of the commits.</p><h4>Democratic network of nodes</h4><p>As far as decentralisation goes, similarly to Bitcoin blockchain network, all git repository clones work in a democratised manner. Either one of repository clones (nodes in a blockchain network) has equal rights and is privileged to propose new changes to the blockchain. Those nodes are able to exchange information between each other. While the Bitcoin blockchain implements a stateful peer-to-peer two-way communication, with git this process is simplified to manual pushing and pulling. Either way, those git nodes exchange information between each other in order to determine what the blockchain really looks like. Git nodes will work together on obtaining common consensus — just like Bitcoin nodes do. The way they do it is just slightly different.</p><h4>Immutability of data</h4><p>Blockchain governs the transactions it holds by the very characteristics of how blocks are related to one another. Git creates new blocks (commits) in very same way all cryptocurrencies do — by hashing block contents together with meta data and hash of the previous block, making the blockchain immutable and impossible to counterfeit.</p><p>This prevents Bitcoin transactions from being forged. If a single block or transaction from the past was changed, the whole blockchain would have to be rewritten from that point in time. The very same thing happens with Bitcoin. Whenever you want to change a block (commit) from history, you would have to recreate all the subsequent blocks after it. This operation generally boils down to a git mechanism called rebase. Even though it is possible with git, this operation is discouraged whenever it considers commits already pushed to remote (shared with network nodes). This of course aims at avoiding situations of rewriting the history of the repository cloned by other users. As with git it is all about users’ good will and mutual trust, Bitcoin relies on Proof of Work algorithm to mitigate trust issues.</p><p>Both blockchains (git as well as Bitcoin) offer a possibility for the conflict to emerge. Both technologies address this issue in its own way. While Bitcoin will simply pick up the longest chain, git will resolve all the conflicts during the merge process.</p><p>One major difference between the git and Bitcoin blockchain would be the impossibility of permanent Bitcoin blockchain branching (excluding so called hard forks). With Bitcoin, all history of transactions has to be linear, which together with Proof of Work algorithm governs the blockchain and prevents from double spending. Git, however, offers a possibility of branching out with a new chain of blocks (commits), and then merging different branches into one change set. Although it is not possible with Bitcoin, similar concepts have been introduced in the case of some other cryptocurrencies.</p><h4>Conclusion</h4><p>Wrapping things up, from my point of view, understanding how git works under the hood clears up a lot of questions around what blockchain is. It really is an implementation of the blockchain mechanics described by Satoshi Nakamoto in his white paper (with few differences). It also means that new ideas emerge from already existing ones in the process of constant adoption and improvement. We are the witnesses as well as makers of the digital evolution.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc685a68c4bb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/intive-developers/the-blockchain-you-already-know-dc685a68c4bb">The blockchain you already know</a> was originally published in <a href="https://medium.com/intive-developers">intive Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>