Can you do the next video on how to make a peer to peer network!
@GeeksOasis_6 жыл бұрын
yeaaa please
@vlad9816 жыл бұрын
Amazing! Please, keep up making this series!
@digitalart3216 жыл бұрын
Excellent! You made Blockchain comprehensible for children
@javierpernasalvarez29974 жыл бұрын
I would say one of the best points of the tutorial are your comments on how things world in real life (Bitcoin) and the relationship with what you examplify here. Nice job!
@leonhardeuler98396 жыл бұрын
I followed the series until this video, now my mind is actually blown up.
@HomesteadAce6 жыл бұрын
Awesome series! Just a note, in your minePendingTransaction method you forgot to set the previousHash of the block as you did in the addBlock()
@curious_one11563 жыл бұрын
Yeah. Exactly, why did the function still work ?
@dotkoon2 жыл бұрын
@@curious_one1156 In this video he didn't validate the blocks. But in the next video, the code has been fixed.
@nathanstroud48792 жыл бұрын
@@dotkoon Defiantly weird, I am getting an "invalid array length" error, so this is because of the isChainValid() or mineBlock() function?
@olegwarkentin29936 жыл бұрын
is this series go on? like "how to create a wallet" or synch with clients? :)
@OmarJIBAR2 жыл бұрын
Amazing series 👍My area of interest has nothing to do with blockchains but your series captivated me. Thanks a lot.
@PeterBatah3 жыл бұрын
Thank you for sharing your time and expertise with us. I will definitely be going to bed a little bit smarter tonight. Have a safe and wonderful day!
@desireco6 жыл бұрын
Thank you, this series have been awesome. I am familiar with bitcoin but didn't expect you will be able to cover so much in such short time.
@ollimac736 жыл бұрын
amazing, please continue with these great video tutorials. Thanks for the ones you have done so far.
@Loschcode6 жыл бұрын
Absolutely great and simple explanation to how blockchain actually works. Keep the good work !
@Angelosanto6 жыл бұрын
These videos are perfect, it would be awesome if you continued the series.
@itcrespo6 жыл бұрын
thanks for these videos, the simplest training for blockchain I've found
@mattha37876 жыл бұрын
Please do more, love it.
@malowwang62116 жыл бұрын
Thank you for sharing, savjee! Great videos! Expect much more videos from you
@AbrarAhmed56 жыл бұрын
These videos are amazing! Please keep them coming.
@frediopratamad23493 жыл бұрын
Thank you savejee, your explanation was given from heaven :D Amazing
@wildtigers12106 жыл бұрын
I think `getBalanceOfAddress()` should also check the balance of `fromAddress` ? before deducting coin from it ?
@thejoker5856 жыл бұрын
Mining reward should be added to the current block being mined. It is logical to think that a miner would like to get paid the second she verified the block and not wait for the next block, otherwise theoretically she will have to pay a fee (in BTC network that is both expensive and time consuming).
@thejoker5856 жыл бұрын
But otherwise a great tutorial!
@frknbasaran3 жыл бұрын
Thanks for this great series. I just joined your channel but you definitely deserve more.
@Chino7477476 жыл бұрын
great vid and tutorial, please keep on adding to these. I'm sure they'll be very popular
@dec41rus6 жыл бұрын
Savjee, your explanation is great. Thank you very much
@yuichibencoolenhrs55276 жыл бұрын
Thank you for this video. Please continue this series and I look forward to (Part4) (Part5) and so on.
@AkhileshJain06056 жыл бұрын
Great work Savjee. Would really love it if you explained the ethereum blockchain in your videos!
@rleevzlno6 жыл бұрын
Yeiiii I was waiting for this! Thanks for keep uploading :)
@ongxa8886 жыл бұрын
Thank you very much ! Your explaination is simply and easy to understand !
@wrekktime6 жыл бұрын
you left "this.index" in calculate hash :)
@simplyexplained6 жыл бұрын
Yep! I fixed it on GitHub together with some other issue's... Sorry about that!
@sauro285 жыл бұрын
where can i find it?
@MenOfPurposeHQ6 жыл бұрын
Please add more to this series!
@Jonathan-br8dn6 жыл бұрын
Hi, fantastic series, I am eager to see new videos. regards!
@mahdipakravan6764 жыл бұрын
This is Fucking Best Quality OF Learning Blockchain !
@josephnyc6 жыл бұрын
I wish everyone in life was explained in OOP, damn fun to watch. Keep it coming, create a Wallet class Savjee! I’m curious, did you make all properties and methods public just for the tutorial? The Chain and Block classes are so exposed it would be very simple to alter, no? IMHO the properties should be private at the least.
@simplyexplained6 жыл бұрын
Yes everything is public. Javascript doesn't have 'private' properties.
@josephnyc6 жыл бұрын
Savjee I’m aware, didn’t literally mean public/private, I meant public as in own property, and thought there were ways of achieving private properties with symbols, closures, weakmaps, etc., was just curious to your thoughts on this. I dunno. Love the tutorials!
@rorythewriter6 жыл бұрын
@@simplyexplained How do you make properties that can't be changed in Javascript then? Sorry, I'm not used to js, so not having private seems counterintuitive
@simplyexplained6 жыл бұрын
There isn't a good way to do that in Javascript. Most people prefix private variables with an underscore to show that they shouldn't be directly accessed.
@daniellaerachannel6 жыл бұрын
Excellent man! great tutorial
@ryankdavidson6 жыл бұрын
Great video series, short and sweet
@ThomasOrlita6 жыл бұрын
Nice video! I don't need to create a blockchain in javascript, it's just interesting to watch it... Subscribed to catch new videos! :) Btw you forgot to update this.index and this.data on line 21. (ok I see that it's fixed on github)
@sikwee3 жыл бұрын
Can you do a video on how to implement proof of stake in a javascript blockchain?
@owaisali1243 жыл бұрын
so basically when a reward is given to a miner, it is added in pending transactions, but on second iteration it again adds reward for the miner and this will not end, the whole chain will look like reward of the miner of mining his own reward
@darrenlefcoe6 жыл бұрын
works, well done. good education... look forward to next video.
@swapnilgt6 жыл бұрын
Nice demonstration. Thank you!
@curious_one11563 жыл бұрын
The previousHash is not included in this code. He removed the addBlock method with the minePendingTransactions, but did not assign previousHash before mining the block. Besides, he did not remove the index from the hash calculation. He is surely running git code, not this one shown. This would generate an error in the hash function.
@yourlifeonpower6 жыл бұрын
Bro! Please develop this tutorial into a course package! I will be very happy to pay for your course and learn from you!
@yourspanishstories6 жыл бұрын
Thanks, now I'll go make my own crypto currency.
@simplyexplained6 жыл бұрын
Please don't...
@disnelson3083 жыл бұрын
I love your tutorial. It is simply t]one of the best here. Please can you build a UI to interact with the application. And consider adding a P2P network too. Thanks
@adlvlaw6 жыл бұрын
Very clear, top quality videos!
@Glosoliful6 жыл бұрын
Loving video! You really know something only if you can explain it to your old mother or you can code it!
@rd90556 жыл бұрын
Great video! Please make a video on Tor in simply explained series
@ceorecdeclec97746 жыл бұрын
Will you add private/public keys and how can you implement the peer to peer network
@Metachief_X6 жыл бұрын
Hey Savjee. Can you make a more detailed video in depth about how to actually do peer-to-peer trading?
@59066463 жыл бұрын
Fabulous! Great Work! Tahnk you
@joeysipos3 жыл бұрын
So a bitcoin block is basically a big block of transactions... ah ok, makes sense. Didn't know that before.
@dawnthomas17233 жыл бұрын
The getBalanceOfAddress returns 0 for every transaction. I have checked the code against the code in the video and it does not return the balance as your sample code. Are you running the sample code from the video, or are you running the code from git?
@curious_one11563 жыл бұрын
See, the previousHash is not included in this code. He removed the addBlock method with the minePendingTransactions, but did not assign previousHash before mining the block. Besides, he did not remove the index from the hash calculation. He is surely running git code, not this one.
@as2692 жыл бұрын
the same issue i face did you resolve it?
@PendemiGod6 жыл бұрын
Great work thanks so much!
@priteshvaviya60765 жыл бұрын
Hey why haven't we changed the calculateHash function??
@IbanVan6 жыл бұрын
Exellent, one question, How i can save the blockchain (transactions) filesystem or DB ?
@AhmedAdel-ql5dt5 жыл бұрын
I followed your steps and I am facing the problem , I can't reward the miner and after mining the second block it gives me your balance is 0
@sunjiangkang53532 жыл бұрын
Thanks for your explaination
@marcellorinaldomartina55936 жыл бұрын
Have you forgot to update block.previousHash in minePendingTransactions?
@Leoninmiami6 жыл бұрын
yes, he did. I created a "printBlocks method in the blockChain class that prints all the blocks to the console. The blocks are missing the previous hash. printBlocks() { for(const block of this.chain) { console.log('====================== ', JSON.stringify(block, null, 4 )); } } I fixed it as a param when creating the block in the minePendingTransactions method ... minePendingTrasactions(miningRewardAddress) { let block = new Block(Date.now(), this.pendingTransactions, this.getLatestBlock().hash); .... I'll probably need to change it in the next video ... but I'm happy with my solution, for now.
@BulentSvr6 жыл бұрын
Dear Savjee, Can you do a Simply Explained Video about "EOS"
@agr__76 жыл бұрын
amazing man, amazing! Good job!
@18Maxic6 жыл бұрын
Excellent man , thanks you
@blackmennewstyle6 жыл бұрын
Once you started mining crypto-currencies, there is no going back unless your electricity bills become way too salty...
@Deetoya6 жыл бұрын
This really Helped.... LOved iT...
@asolomon156 жыл бұрын
This was an awesome tutorial
@myhandle3643 жыл бұрын
Wow, this is what I'm looking for on youtube. I'm still curious on (6.38) how p2p network a fool proof?
@marcwyss81006 жыл бұрын
Noob question: Line 52 when you create a new Block: are we not missing the parameter for previousHash? Because when I „console.log“ the blocks, my previous hashes are all at the default ‚0‘.
@marcwyss81006 жыл бұрын
Default value being ‘ ‘ and not 0.
@rijumukherjee52804 жыл бұрын
Hey Savjee I dont understand the concept how miners get out of the loop,Say 'A' transferred X coins to 'B' and now say 'C' mined for this transaction and now again another transaction i.e. reward transaction is obtained and so this will again be mined by 'C' so again it will create a new transaction.....This will continue...So how to break this loop....
@desireco6 жыл бұрын
There is one more thing. address1 doesn't have anything to it, so I added a transaction to genesis block which resolved the issue.
@ShogunWarrior366 жыл бұрын
I really enjoyed this 3 part tutorial. Nice work! Xavier, do you happen to be Flemish by any chance?
@simplyexplained6 жыл бұрын
Yes I am ;)
@dipanwitachanda4446 жыл бұрын
Waiting for your next video
@scarlettcrofts31684 жыл бұрын
How do I solve the TypeError: block.transactions is not iterable ??
@frankr.34136 жыл бұрын
Great! I wish I could coding like you.
@aigerimiskakova9634 жыл бұрын
Good Explanation!
@beunmin66 жыл бұрын
Awesome! now i can make an ICO
@caochihai2 жыл бұрын
Thanks for your video, it was really helpful for me. Can you explain why we don't have a balance in reality? Why do we have to calculate it by going through all transactions? Thank you so much
@simplyexplained2 жыл бұрын
Keeping track of balances would waste storage space without any benefits. Remember: blockchains are immutable. You can't change something that's already inside. If you want to keep track of balances, you would have to do that in every block.
@jamiegabbay72324 жыл бұрын
Apologies, but why is that two transactions are set initially (the add1 to add2 of 100, and the add2 to add1 of 50) yet the 2nd transaction seems to be skipped over? Shouldn't both transactions be completed before xavier recieves his reward?
@liatris693 жыл бұрын
This is gold!
@rosseaux6 жыл бұрын
Can you also make a tutorial with a proof-of-stake variant?
@chrisreilly856 жыл бұрын
Can you explain how luck factors into this for a miner? If I understand correctly, the miner is simply changing the nonce until the block difficulty is met (please confirm if I'm incorrect here). If so, wouldn't every miner start at nonce 0 and work up by 1 sequentially, therefore whoever has the most computing power would solve every block? Or, is it more efficient to randomize the nonce? Thanks for a great video series.
@javajava74756 жыл бұрын
Please make a series on making a wallet for our cryptocurrency
@DeepakSharma56 жыл бұрын
Great videos! Helped me a lot in understanding block chain. Correct me if I am wrong but I think this new block chain will not be valid because you are not setting previousHash while creating new block in your minePendingTransaction function.
@niter436 жыл бұрын
He forgot to pass it to constructor, yes.
@brianjianzhao32384 жыл бұрын
Hey Savjee, why we still need to have prevHash as a property for each block and as part of the input for the current hash calculation? It seems to me it never gets used in this video's implementation.
@stormhess86226 жыл бұрын
Thank you for taking the time to make this video...how would I implement an html frontend interface for it? Since it is to be highly secure, is there any specific calling conventions from html to the script or is as simple as an onClick() event to trigger the transaction? Cheers.
@jackjangdude4 жыл бұрын
He deletes the addblock method that assigns the previousHash argument to the previous hash, but when he replaces it with the minePendingTransaction the block that gets pushed never includes the previous hash. Maybe I missed something...
@nileenaj39644 жыл бұрын
In the description box, he has mentioned that he made a mistake and forgot to add the previous hash value.
@gaborzsoter3 жыл бұрын
Hey, if you continue to run mineTransactions() again and again you actually mining your reward and get rewarded which you can mine and get rewarded infinitely? What am I missing?
@jayantkhandelwal73264 жыл бұрын
Hi, I have a doubt, as we have removed the reference to previous hash when we removed addblock method, then how are we implementing a blockchain without having previous hash value? Please help me in clarifying my doubt!
@curious_one11563 жыл бұрын
IDK myself. Maybe he ran the code from git, and not this one.
@adhoom2 жыл бұрын
I don't know whether this changes in the upcoming videos or not. But, something that is really bothering me is that the user specifies the index for his block. Why is it not controlled by like a static field that keeps incrementing when a block is added ?
@simplyexplained2 жыл бұрын
Good point. In fact, that index isn't needed at all. It was deleted from the GitHub repository but unfortunately I cannot update videos. github.com/Savjee/SavjeeCoin/blob/master/src/blockchain.js
@chregig79675 жыл бұрын
Wow, thank you so much, I've been struggling with understanding how bitcoin, mining and the blockchain as a whole worked for a couple of years now and your videos finally cleared up so many questions! Now, if someone reads this, I have a question about one aspect that I am not too sure I understood correctly. You said the mined amount will get added with the next mined block, but in reality that would be very counter productive, would it not? Otherwise, nobody could actually make any transactions, because all of the blocks are used up to pay the rewards...? Or am I missing something?
@simplyexplained5 жыл бұрын
Ah, well there is only 1 miner that can mine a block. So each block creates just 1 'reward' transaction in the next.
@masoudkhoda91615 жыл бұрын
Nice job. only one question. In your codes, as I checked, you set previous Hash by creating a block. Suppose that, "L" is the current last block in a chain. Block "A" and "B" are created at the same time. So they set their previous hash with the same hash e.g. Hash of "L". What happens by mining when both of them are mined successfully, but B was mined faster. Therefore normally the previous hash of "B" is correct, but the previous hash of "A" should be changed to the hash of "B". What I want to reach, I think assigning previous hash by creating a block is not necessary, but by mining. Am I right?
@denislupookov78956 жыл бұрын
OMG! It is something amazing!
@ru421126 жыл бұрын
Have you done a video explaining the difference between pow (bitcoin) and pos?
@simplyexplained6 жыл бұрын
Yes I have... It's going live later today 😂🤐
@ru421126 жыл бұрын
Simply Explained - Savjee that was quick I'll be looking for it thanks. I also don't understand why all crypto projects have to have a coin or token involved in it.
@der-lotse5 жыл бұрын
So pending transctions aren't secured by the blockchain before mining. They are "just there" in the system right? They will get commited by a miner when his mining is succesful. Did I understand it correctly? Why could a miner not change the transaction before the mining is complete and therefore no hashing for the particular transactions is established at this point?
@simplyexplained5 жыл бұрын
Yes you understood correctly. However each transaction is digitally signed with the private key of the sender. When a Miner changes the transaction, the signature becomes invalid and the Miner can't re-sign it because he doesn't have the correct private key to do so.
@g_pazzini6 жыл бұрын
I have a question. Ideally, does a block contain multiple transactions or only one? if it's multiple, are the transaction grouped by certain parameter (e.g. contains transactions with the same fromAddress), or just random?
@VoTinhThuong6 жыл бұрын
Hi Savjee! I see in this video you said that you have fix the problem about minePendingTransactions() method in Github. But when I use your code in Github, it still have an error about reward like in your video. I still have to mine twice so that I could have receive the coin??? Why I can't reward the coin in the first time mining?
@g_pazzini6 жыл бұрын
it's not an error... at the first time mining, you processed those 2 initial transactions. you haven't got rewarded.... after 1st mining, you got a reward which is posted as "pending" transaction and it's not in the block yet. that's why you need to do 2nd mining to have it in the block.
@shandonanderson39676 жыл бұрын
Can we expect to see the other videos uploaded for this series?
@simplyexplained6 жыл бұрын
Yes, but not in the immediate future. Sorry about that! But you can help make it faster. Checkout the code on GitHub, make a pull request with new features and I could make a new video about it (and give you full credit ofcourse)
@yuefeima62016 жыл бұрын
great videos, thanks
@williamokano6 жыл бұрын
Hi Savjee, but why not instead of leaving the balance of the miner to the next block you can't auto insert this transaction into the pending transactions plus setting a new property called "minedBy" to show that the miner really put some efforts into the mining? With this you can ensure that the token will be "instantly" transfered and anyone that can check the chain can build correctly the miners balance.
@simplyexplained6 жыл бұрын
Sure, you could put the mining reward in the same block. However there is no need to add the "minedBy" property. You know who mined the block by checking where the mining reward went to ;)
@ringoyip09016 жыл бұрын
This is amazing! The only question I have is: once a pending transaction has been resolved, will it get deleted? Do we need to create a method for deleting a resolved pending transaction?
@simplyexplained6 жыл бұрын
When a transaction is added to a block, we don't have to keep it in the pending transactions. The code does this by redefining the pendingTransactions array
@j8577798yt6 жыл бұрын
Very good!!!
@softtech56305 жыл бұрын
Hay un error en el codigo de muestra que calcula el Hash porque está así: calculateHash() { return SHA256(this.index + this.timestamp + JSON.stringify(this.data)+ this.nonce).toString(); } Y DEBE QUEDAR ASI: calculateHash() { return SHA256(this.previousHash + this.timestamp + JSON.stringify(this.transactions) + this.nonce).toString(); }
@rliy0016 жыл бұрын
In a"real blockchain", does it really keep adding the mining reward to the pending transactions list; and then another miner has to mine that transaction? Wouldn't this create an endless cycle of rewards, which of cause keeps introducing new bitcoins to the system. What I thought happens when someone mines a block is that the mining reward is added to the same block that just got mined. Is that right?
@rja_live6 жыл бұрын
One block keeps many transactions, so it can includes one more transaction to reward previous miner