---
title: "Discussion on \"Building a Simple JavaScript Blockchain\" | Hashnode"
description: "Discussion on \"Building a Simple JavaScript Blockchain\". When I learn about a new technology, I like to dive in deep: reading articles and documentation, watching videos, and experimenting with code. Recently, I got into blockchain technology and after wrapping my head around the initial concept, I was ins..."
url: "https://hashnode.com/posts/building-a-simple-javascript-blockchain/61199742ac5c985f36436e89"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Building a Simple JavaScript Blockchain](https://andrewbruner.hashnode.dev/building-a-simple-javascript-blockchain?utm_source=hashnode&utm_medium=feed)

When I learn about a new technology, I like to dive in deep: reading articles and documentation, watching videos, and experimenting with code. Recently, I got into blockchain technology and after wrapping my head around the initial concept, I was ins...

Aug 15, 2021 · 6 min read · andrewbruner.hashnode.dev  
Read the article

-   [#blockchain](https://hashnode.com/tag/blockchain)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#tutorial](https://hashnode.com/tag/tutorial)

## Written by

[Andrew Bruner](https://hashnode.com/@andrewbruner)

@andrewbruner · Ohio, US

  
[View profile](https://hashnode.com/@andrewbruner)

Front-end Web and JavaScript Developer

## Responses 1

Markdown supported · ⌘↵ to post

[Sarthak Verma](https://hashnode.com/@sarthakv)

[Sep 1, 2021](https://hashnode.com/posts/building-a-simple-javascript-blockchain/61199742ac5c985f36436e89/comment/612f6478bb796223ef279950)

Great article, but how are you able to use the `SHA256` function without importing it into `blockchain.js`?

By doing as you instructed, I am getting this error in the console.

```
blockchain.js:6 Uncaught ReferenceError: SHA256 is not defined
    at new Block (blockchain.js:6)
    at new Blockchain (blockchain.js:24)
    at <anonymous>:1:18
```

[Andrew Bruner](https://hashnode.com/@andrewbruner)

[Sep 27, 2021](https://hashnode.com/posts/building-a-simple-javascript-blockchain/61199742ac5c985f36436e89/comment/612f6478bb796223ef279950#reply-61521117040ee8723695066c)

Hi [Sarthak Verma](https://hashnode.com/@sarthakv), Thanks for following along! So I have included the **sha256.js** file in a script tag in the body of the html file, and then the **blockchain.js** file (in that order).

The blockchain.js functions can then access everything from the preceding file as they are both imported into **index.html**.

I hope that clears things up. Good luck on your cryptojourney!
