Blockchain.FromScratch.StepByStep
This is a project made for YouTube stream
Install / Use
/learn @podkolzzzin/Blockchain.FromScratch.StepByStepREADME
#This is code for the stream. You can watch it live here.
#Encoding
f(x) = y, g(y) = x
#Hash Function
f(data) = code
Doesn't exist: g(code) = data
Collision: f(x1) = y, f(x2) = y, x1 != x2
Probably: f(x1) = y, f(x2) = y, x1 = x2
Guarantied: f(x1) = y, f(x2) = z, y != z, x1 != x2
#Encryption
f(data, key) = cryptotext
Doesn't exist or too expensive:
g(cryptotext) = data
g(cryptotext, data) = key good encryption
#Asymmetric encryption
f(data, publicKey) = cryptotext
g(cryptotext, privateKey) = data
#Digital Sign
f(data, privateKey) = cryptotext
g(cryptotext, publicKey) = data => is was encrpyted by private key
##Verify Identity
Alice: Encrypt this, please - randomHash
Bob: f(randomHash, privateKey) = cryptotext
Alice: g(cryptotext, publicKey) = randomHash => It is definitely Bob
#Blockchain
- block(parentHash, data)
block(null, data1)
block(hash(data1), data2)
block(hash(hash(data1) + data2), data3)
block(hash(hash(hash(data1) + data2) + data3, data4)
##Transactions
- Address is public key
- Address owner holds privateKey
Transaction(
From // Sender's publicKey
To // Receiver's publicKey
Ammount,
Sign // Sign(From + To + Ammount, Senders privateKey)
)
###Verify Transaction
- From is the owner of asset at the current state of chain
- Transaction is signed by From's privateKey
Related Skills
node-connect
345.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
104.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
345.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
345.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
