SlideShare a Scribd company logo
1 of 17
Bitcoin 
Natalie , Joe, Nattapon
Aim and Objectives 
● Aim 
o Increase hash rate through hardware 
● Objectives 
o Implement Bitcoin hashing algorithm 
 hardware (Zedboard ) 
 software 
 offline and online miner 
● Result 
o compare past block hash performance
Prototype 1 and 2 
● Laptop 
o java SHA256 and API 
server connection 
● Zedboard 
o SHA256 and Mmap 
● Laptop 
o Scripting connection 
● Zedboard 
o Java and HW - SHA256 
o C - Mmap
Purpose of P1 and P2 
● Prototype 1 
o testing Java SHA256 and Bitcoin API 
o Serial connection with Zedboard 
● Prototype 2 
o testing java SHA256 on Zedboard 
o testing Server Connection Scripting 
o testing Mmap
Final Design 
Lightweight Miner 
- no blockchain 
- Java handle 
Connection 
- API, JSON-RPC 
- Submit and Get block 
- SHA256 on C
SHA-256 pseudocode (1) 
Pre-processing: 
append the bit '1' to the message 
append k bits '0', where k is the minimum number >= 0 such that the resulting 
message 
length (modulo 512 in bits) is 448. 
append length of message (without the '1' bit or padding), in bits, as 64-bit big-endian 
integer 
(this will make the entire post-processed length a multiple of 512 bits)
SHA-256 pseudocode (2) 
Process the message in successive 512-bit chunks: 
break message into 512-bit chunksfor each chunk 
create a 64-entry message schedule array w[0..63] of 32- 
bit words (The initial values in w[0..63] don't matter, so 
many implementations zero them here) 
copy chunk into first 16 words w[0..15] of the message 
schedule array Extend the first 16 words into the remaining 
48 words w[16..63] of the message schedule array: 
for i from 16 to 63 
s0 := (w[i-15] rightrotate 7) xor (w[i-15] rightrotate 
18) xor (w[i-15] rightshift 3) 
s1 := (w[i-2] rightrotate 17) xor (w[i-2] rightrotate 
19) xor (w[i-2] rightshift 10) 
w[i] := w[i-16] + s0 + w[i-7] + s1 
Initialize working variables to current hash value: a := h0 
b := h1 
c := h2 
d := h3 
e := h4 
f := h5 
g := h6 
h := h7 
Compression function main loop: 
for i from 0 to 63 
S1 := (e rightrotate 6) xor (e rightrotate 11) xor (e 
rightrotate 25) 
ch := (e and f) xor ((not e) and g) 
temp1 := h + S1 + ch + k[i] + w[i] 
S0 := (a rightrotate 2) xor (a rightrotate 13) xor (a 
rightrotate 22) 
maj := (a and b) xor (a and c) xor (b and c) 
temp2 := S0 + maj
SHA-256 - Pseudocode (3) 
h := g 
g := f 
f := e 
e := d + temp1 
d := c 
c := b 
b := a 
a := temp1 + temp2 
Add the compressed chunk to the current hash value: 
h0 := h0 + a 
h1 := h1 + b 
h2 := h2 + c 
h3 := h3 + d 
h4 := h4 + e 
h5 := h5 + f 
h6 := h6 + g 
h7 := h7 + hProduce the final hash value (big-endian):digest := hash := h0 append h1 append h2 append h3 append h4 
append h5 append h6 append h7
Hardware - SHA256 Algorithm 
1024bits header (608bits +32bits 
nonce+info) 
512 bits 512bits(128 bits+’1’+zeros + 
64bits length info) 
message chunk 
hashing 
Initialized hash 
values 
message chunk 
hashing 
256bits hash 
output(first rnd) 
512bits(256bits +‘1’+zeros 
+ 64 bits length info) 
message chunk 
Initialized hash hashing 
values 
256bits hash output 
(second round)
Hardware - SHA256 Algorithm 
● Brifely consists of 3 message chunk hashing 
message chunk 
hashing 
message chunk 
hashing 
message chunk 
hashing 
h0-h7 
initial 
h0-h7 
initial 
h0-h7 
Messagechunk 1 
Messagechunk 2 Messagechunk 3 
unit 
1. with some inputs from outputs of preprocessing
Hardware - Structural sha256 
● Saving resources e.g 
(LUT/slices) 
1. multiple array64vectors of 32 bits: word,k 
2. Parallel calculations not entirely feasible 
● trade-off : time 
1. One round of MessageChunk will be 
completed in 64 clk cycles. So SHA 256 
will be completed in 64x3 = 192 ckls. 
2. Search for the right nonce can be very 
exhaustive effort
Hardware - Structural sha256 
wordext(0) 
wordext(1) 
wordext(2) 
wordext(3) 
… 
… 
… 
… 
… 
… 
.. 
wordext(47) 
compress(0) 
… 
… 
… 
… 
… 
… 
.. 
compress(16) 
compress(17) 
compress(18) 
compress(19) 
… 
… 
… 
compress(63) 
hashout 
initial hash values 
Component C 
48 64 1 
Total = (48+64+1)*3=452 
Each instance does hugh 
amount of calculation
Hardware - Structural sha256 
512-bit message 
div in 16 32-bit 
Mem( 
word[0...63]) 
wordext 
Shift_regs(15) 
Shift_regs(14) 
… 
Shift_regs(9) 
… 
Shift_regs(1) 
Shift_regs(0) 
h0 h7 
……... 
mux(0) mux(7) 
compress 
h0 h7 
Component C 
… 
hash output 
Total 3 instances chunk 
Each hugh Mem ( 
k[0...63]) 
……... 
a …….. h 
.
Top Level 
● Increment Nonce from 0 to 0xFFFFFFFF 
big_endian_32 
SHA Algorithm 
Top 
big_endian_256 
Cnt 
Compare with target 
Header Nonce 
PS 
● If the value less than target then output ‘succeed’ signal 
● else if cnt less than 0xFFFFFFFF increment cnt by 1 
● else output ‘fail’ signal
Problems & Future Improvement 
● Hardware is working in simulation but not working 
correctly with MemoryMap from C 
● Data cannot be correctly read from the desired 
address 
● Create a structural vhdl model that can take 
advantage of parallel calculations further 
Time management 
Task allocation
Gantt Chart
Results & Evaluation 
SW miner hashrate: for 2329 hashes 
Zedboard (667 MHz): ~ 0.35 
khash/s 
Laptop (i5, 2.50GHz): ~ 7.40 
kHhWas Mh/isner 
If applied 667Mhz frequency. 
~ 347 khash/s(192ccl for 1 hash)

More Related Content

What's hot

Next Generation Indexes For Big Data Engineering (ODSC East 2018)
Next Generation Indexes For Big Data Engineering (ODSC East 2018)Next Generation Indexes For Big Data Engineering (ODSC East 2018)
Next Generation Indexes For Big Data Engineering (ODSC East 2018)Daniel Lemire
 
Timur Shemsedinov "Пишу на колбеках, а что... (Асинхронное программирование)"
Timur Shemsedinov "Пишу на колбеках, а что... (Асинхронное программирование)"Timur Shemsedinov "Пишу на колбеках, а что... (Асинхронное программирование)"
Timur Shemsedinov "Пишу на колбеках, а что... (Асинхронное программирование)"OdessaJS Conf
 
function* - ES6, generators, and all that (JSRomandie meetup, February 2014)
function* - ES6, generators, and all that (JSRomandie meetup, February 2014)function* - ES6, generators, and all that (JSRomandie meetup, February 2014)
function* - ES6, generators, and all that (JSRomandie meetup, February 2014)Igalia
 
Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"
Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"
Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"OdessaJS Conf
 
Class 24: Imperative Programming
Class 24: Imperative ProgrammingClass 24: Imperative Programming
Class 24: Imperative ProgrammingDavid Evans
 
Hash functions MD5 and RIPEMD 160
Hash functions MD5 and RIPEMD 160Hash functions MD5 and RIPEMD 160
Hash functions MD5 and RIPEMD 160chutinhha
 
To Infinity & Beyond: Protocols & sequences in Node - Part 2
To Infinity & Beyond: Protocols & sequences in Node - Part 2To Infinity & Beyond: Protocols & sequences in Node - Part 2
To Infinity & Beyond: Protocols & sequences in Node - Part 2Bahul Neel Upadhyaya
 
Porting and optimizing UniFrac for GPUs
Porting and optimizing UniFrac for GPUsPorting and optimizing UniFrac for GPUs
Porting and optimizing UniFrac for GPUsIgor Sfiligoi
 
Reversible Logic Synthesis and RevKit
Reversible Logic Synthesis and RevKitReversible Logic Synthesis and RevKit
Reversible Logic Synthesis and RevKitMathias Soeken
 
Big Data in Real-Time: How ClickHouse powers Admiral's visitor relationships ...
Big Data in Real-Time: How ClickHouse powers Admiral's visitor relationships ...Big Data in Real-Time: How ClickHouse powers Admiral's visitor relationships ...
Big Data in Real-Time: How ClickHouse powers Admiral's visitor relationships ...Altinity Ltd
 
Modern c++ Memory Management
Modern c++ Memory ManagementModern c++ Memory Management
Modern c++ Memory ManagementAlan Uthoff
 
Weather of the Century: Visualization
Weather of the Century: VisualizationWeather of the Century: Visualization
Weather of the Century: VisualizationMongoDB
 
Fast indexes with roaring #gomtl-10
Fast indexes with roaring #gomtl-10 Fast indexes with roaring #gomtl-10
Fast indexes with roaring #gomtl-10 Daniel Lemire
 
Building a DSL with GraalVM (VoxxedDays Luxembourg)
Building a DSL with GraalVM (VoxxedDays Luxembourg)Building a DSL with GraalVM (VoxxedDays Luxembourg)
Building a DSL with GraalVM (VoxxedDays Luxembourg)Maarten Mulders
 

What's hot (20)

Next Generation Indexes For Big Data Engineering (ODSC East 2018)
Next Generation Indexes For Big Data Engineering (ODSC East 2018)Next Generation Indexes For Big Data Engineering (ODSC East 2018)
Next Generation Indexes For Big Data Engineering (ODSC East 2018)
 
ulimit
ulimit ulimit
ulimit
 
Timur Shemsedinov "Пишу на колбеках, а что... (Асинхронное программирование)"
Timur Shemsedinov "Пишу на колбеках, а что... (Асинхронное программирование)"Timur Shemsedinov "Пишу на колбеках, а что... (Асинхронное программирование)"
Timur Shemsedinov "Пишу на колбеках, а что... (Асинхронное программирование)"
 
Debugging TV Frame 0x0D
Debugging TV Frame 0x0DDebugging TV Frame 0x0D
Debugging TV Frame 0x0D
 
Solr sparse faceting
Solr sparse facetingSolr sparse faceting
Solr sparse faceting
 
function* - ES6, generators, and all that (JSRomandie meetup, February 2014)
function* - ES6, generators, and all that (JSRomandie meetup, February 2014)function* - ES6, generators, and all that (JSRomandie meetup, February 2014)
function* - ES6, generators, and all that (JSRomandie meetup, February 2014)
 
Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"
Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"
Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"
 
Class 24: Imperative Programming
Class 24: Imperative ProgrammingClass 24: Imperative Programming
Class 24: Imperative Programming
 
Hash functions MD5 and RIPEMD 160
Hash functions MD5 and RIPEMD 160Hash functions MD5 and RIPEMD 160
Hash functions MD5 and RIPEMD 160
 
To Infinity & Beyond: Protocols & sequences in Node - Part 2
To Infinity & Beyond: Protocols & sequences in Node - Part 2To Infinity & Beyond: Protocols & sequences in Node - Part 2
To Infinity & Beyond: Protocols & sequences in Node - Part 2
 
Porting and optimizing UniFrac for GPUs
Porting and optimizing UniFrac for GPUsPorting and optimizing UniFrac for GPUs
Porting and optimizing UniFrac for GPUs
 
同態加密
同態加密同態加密
同態加密
 
Reversible Logic Synthesis and RevKit
Reversible Logic Synthesis and RevKitReversible Logic Synthesis and RevKit
Reversible Logic Synthesis and RevKit
 
#2 (UDP)
#2 (UDP)#2 (UDP)
#2 (UDP)
 
Big Data in Real-Time: How ClickHouse powers Admiral's visitor relationships ...
Big Data in Real-Time: How ClickHouse powers Admiral's visitor relationships ...Big Data in Real-Time: How ClickHouse powers Admiral's visitor relationships ...
Big Data in Real-Time: How ClickHouse powers Admiral's visitor relationships ...
 
Modern c++ Memory Management
Modern c++ Memory ManagementModern c++ Memory Management
Modern c++ Memory Management
 
Weather of the Century: Visualization
Weather of the Century: VisualizationWeather of the Century: Visualization
Weather of the Century: Visualization
 
Algoritma
AlgoritmaAlgoritma
Algoritma
 
Fast indexes with roaring #gomtl-10
Fast indexes with roaring #gomtl-10 Fast indexes with roaring #gomtl-10
Fast indexes with roaring #gomtl-10
 
Building a DSL with GraalVM (VoxxedDays Luxembourg)
Building a DSL with GraalVM (VoxxedDays Luxembourg)Building a DSL with GraalVM (VoxxedDays Luxembourg)
Building a DSL with GraalVM (VoxxedDays Luxembourg)
 

Viewers also liked

공인인증서 크래킹 - Inc0gnito 2015
공인인증서 크래킹 - Inc0gnito 2015공인인증서 크래킹 - Inc0gnito 2015
공인인증서 크래킹 - Inc0gnito 2015Hajin Jang
 
Decentrailzed File Sharing
Decentrailzed File SharingDecentrailzed File Sharing
Decentrailzed File SharingJayashree Saraf
 
Analysis-of-Security-Algorithms-in-Cloud-Computing [Autosaved]
Analysis-of-Security-Algorithms-in-Cloud-Computing [Autosaved]Analysis-of-Security-Algorithms-in-Cloud-Computing [Autosaved]
Analysis-of-Security-Algorithms-in-Cloud-Computing [Autosaved]Mahmuda Rahman
 
Distribution of public keys and hmac
Distribution of public keys and hmacDistribution of public keys and hmac
Distribution of public keys and hmacanuragjagetiya
 
Image encryption using aes key expansion
Image encryption using aes key expansionImage encryption using aes key expansion
Image encryption using aes key expansionSreeda Perikamana
 
Advanced Encryption Standard (AES) Implementaion using Java
Advanced Encryption Standard (AES) Implementaion using JavaAdvanced Encryption Standard (AES) Implementaion using Java
Advanced Encryption Standard (AES) Implementaion using JavaSunil Kumar R
 

Viewers also liked (8)

공인인증서 크래킹 - Inc0gnito 2015
공인인증서 크래킹 - Inc0gnito 2015공인인증서 크래킹 - Inc0gnito 2015
공인인증서 크래킹 - Inc0gnito 2015
 
NetworkSecurity
NetworkSecurityNetworkSecurity
NetworkSecurity
 
Decentrailzed File Sharing
Decentrailzed File SharingDecentrailzed File Sharing
Decentrailzed File Sharing
 
Analysis-of-Security-Algorithms-in-Cloud-Computing [Autosaved]
Analysis-of-Security-Algorithms-in-Cloud-Computing [Autosaved]Analysis-of-Security-Algorithms-in-Cloud-Computing [Autosaved]
Analysis-of-Security-Algorithms-in-Cloud-Computing [Autosaved]
 
Distribution of public keys and hmac
Distribution of public keys and hmacDistribution of public keys and hmac
Distribution of public keys and hmac
 
Email security
Email securityEmail security
Email security
 
Image encryption using aes key expansion
Image encryption using aes key expansionImage encryption using aes key expansion
Image encryption using aes key expansion
 
Advanced Encryption Standard (AES) Implementaion using Java
Advanced Encryption Standard (AES) Implementaion using JavaAdvanced Encryption Standard (AES) Implementaion using Java
Advanced Encryption Standard (AES) Implementaion using Java
 

Similar to Implementation of Bitcoin Miner on SW and HW

Data streaming algorithms
Data streaming algorithmsData streaming algorithms
Data streaming algorithmsHridyesh Bisht
 
Hash mac algorithms
Hash mac algorithmsHash mac algorithms
Hash mac algorithmsYoung Alista
 
Hash mac algorithms
Hash mac algorithmsHash mac algorithms
Hash mac algorithmsJames Wong
 
Hash mac algorithms
Hash mac algorithmsHash mac algorithms
Hash mac algorithmsTony Nguyen
 
Hash mac algorithms
Hash mac algorithmsHash mac algorithms
Hash mac algorithmsFraboni Ec
 
Hash mac algorithms
Hash mac algorithmsHash mac algorithms
Hash mac algorithmsDavid Hoen
 
Hash& mac algorithms
Hash& mac algorithmsHash& mac algorithms
Hash& mac algorithmsHarry Potter
 
Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)
Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)
Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)Svetlin Nakov
 
IRJET- Low Power and Simple Implementation of Secure Hashing Algorithm (SHA-2...
IRJET- Low Power and Simple Implementation of Secure Hashing Algorithm (SHA-2...IRJET- Low Power and Simple Implementation of Secure Hashing Algorithm (SHA-2...
IRJET- Low Power and Simple Implementation of Secure Hashing Algorithm (SHA-2...IRJET Journal
 

Similar to Implementation of Bitcoin Miner on SW and HW (20)

Data streaming algorithms
Data streaming algorithmsData streaming algorithms
Data streaming algorithms
 
Hash mac algorithms
Hash mac algorithmsHash mac algorithms
Hash mac algorithms
 
Hash mac algorithms
Hash mac algorithmsHash mac algorithms
Hash mac algorithms
 
Hash mac algorithms
Hash mac algorithmsHash mac algorithms
Hash mac algorithms
 
Hash mac algorithms
Hash mac algorithmsHash mac algorithms
Hash mac algorithms
 
Hash mac algorithms
Hash mac algorithmsHash mac algorithms
Hash mac algorithms
 
Hash mac algorithms
Hash mac algorithmsHash mac algorithms
Hash mac algorithms
 
Hash& mac algorithms
Hash& mac algorithmsHash& mac algorithms
Hash& mac algorithms
 
Secure hashing algorithm
Secure hashing algorithmSecure hashing algorithm
Secure hashing algorithm
 
Sha
ShaSha
Sha
 
Hashfunction
HashfunctionHashfunction
Hashfunction
 
Hashfunction
HashfunctionHashfunction
Hashfunction
 
Hash function
Hash functionHash function
Hash function
 
Hashfunction
HashfunctionHashfunction
Hashfunction
 
Hashfunction
HashfunctionHashfunction
Hashfunction
 
Hashfunction
HashfunctionHashfunction
Hashfunction
 
Hashfunction
HashfunctionHashfunction
Hashfunction
 
MD5
MD5MD5
MD5
 
Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)
Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)
Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)
 
IRJET- Low Power and Simple Implementation of Secure Hashing Algorithm (SHA-2...
IRJET- Low Power and Simple Implementation of Secure Hashing Algorithm (SHA-2...IRJET- Low Power and Simple Implementation of Secure Hashing Algorithm (SHA-2...
IRJET- Low Power and Simple Implementation of Secure Hashing Algorithm (SHA-2...
 

Recently uploaded

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 

Recently uploaded (20)

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 

Implementation of Bitcoin Miner on SW and HW

  • 1. Bitcoin Natalie , Joe, Nattapon
  • 2. Aim and Objectives ● Aim o Increase hash rate through hardware ● Objectives o Implement Bitcoin hashing algorithm  hardware (Zedboard )  software  offline and online miner ● Result o compare past block hash performance
  • 3. Prototype 1 and 2 ● Laptop o java SHA256 and API server connection ● Zedboard o SHA256 and Mmap ● Laptop o Scripting connection ● Zedboard o Java and HW - SHA256 o C - Mmap
  • 4. Purpose of P1 and P2 ● Prototype 1 o testing Java SHA256 and Bitcoin API o Serial connection with Zedboard ● Prototype 2 o testing java SHA256 on Zedboard o testing Server Connection Scripting o testing Mmap
  • 5. Final Design Lightweight Miner - no blockchain - Java handle Connection - API, JSON-RPC - Submit and Get block - SHA256 on C
  • 6. SHA-256 pseudocode (1) Pre-processing: append the bit '1' to the message append k bits '0', where k is the minimum number >= 0 such that the resulting message length (modulo 512 in bits) is 448. append length of message (without the '1' bit or padding), in bits, as 64-bit big-endian integer (this will make the entire post-processed length a multiple of 512 bits)
  • 7. SHA-256 pseudocode (2) Process the message in successive 512-bit chunks: break message into 512-bit chunksfor each chunk create a 64-entry message schedule array w[0..63] of 32- bit words (The initial values in w[0..63] don't matter, so many implementations zero them here) copy chunk into first 16 words w[0..15] of the message schedule array Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array: for i from 16 to 63 s0 := (w[i-15] rightrotate 7) xor (w[i-15] rightrotate 18) xor (w[i-15] rightshift 3) s1 := (w[i-2] rightrotate 17) xor (w[i-2] rightrotate 19) xor (w[i-2] rightshift 10) w[i] := w[i-16] + s0 + w[i-7] + s1 Initialize working variables to current hash value: a := h0 b := h1 c := h2 d := h3 e := h4 f := h5 g := h6 h := h7 Compression function main loop: for i from 0 to 63 S1 := (e rightrotate 6) xor (e rightrotate 11) xor (e rightrotate 25) ch := (e and f) xor ((not e) and g) temp1 := h + S1 + ch + k[i] + w[i] S0 := (a rightrotate 2) xor (a rightrotate 13) xor (a rightrotate 22) maj := (a and b) xor (a and c) xor (b and c) temp2 := S0 + maj
  • 8. SHA-256 - Pseudocode (3) h := g g := f f := e e := d + temp1 d := c c := b b := a a := temp1 + temp2 Add the compressed chunk to the current hash value: h0 := h0 + a h1 := h1 + b h2 := h2 + c h3 := h3 + d h4 := h4 + e h5 := h5 + f h6 := h6 + g h7 := h7 + hProduce the final hash value (big-endian):digest := hash := h0 append h1 append h2 append h3 append h4 append h5 append h6 append h7
  • 9. Hardware - SHA256 Algorithm 1024bits header (608bits +32bits nonce+info) 512 bits 512bits(128 bits+’1’+zeros + 64bits length info) message chunk hashing Initialized hash values message chunk hashing 256bits hash output(first rnd) 512bits(256bits +‘1’+zeros + 64 bits length info) message chunk Initialized hash hashing values 256bits hash output (second round)
  • 10. Hardware - SHA256 Algorithm ● Brifely consists of 3 message chunk hashing message chunk hashing message chunk hashing message chunk hashing h0-h7 initial h0-h7 initial h0-h7 Messagechunk 1 Messagechunk 2 Messagechunk 3 unit 1. with some inputs from outputs of preprocessing
  • 11. Hardware - Structural sha256 ● Saving resources e.g (LUT/slices) 1. multiple array64vectors of 32 bits: word,k 2. Parallel calculations not entirely feasible ● trade-off : time 1. One round of MessageChunk will be completed in 64 clk cycles. So SHA 256 will be completed in 64x3 = 192 ckls. 2. Search for the right nonce can be very exhaustive effort
  • 12. Hardware - Structural sha256 wordext(0) wordext(1) wordext(2) wordext(3) … … … … … … .. wordext(47) compress(0) … … … … … … .. compress(16) compress(17) compress(18) compress(19) … … … compress(63) hashout initial hash values Component C 48 64 1 Total = (48+64+1)*3=452 Each instance does hugh amount of calculation
  • 13. Hardware - Structural sha256 512-bit message div in 16 32-bit Mem( word[0...63]) wordext Shift_regs(15) Shift_regs(14) … Shift_regs(9) … Shift_regs(1) Shift_regs(0) h0 h7 ……... mux(0) mux(7) compress h0 h7 Component C … hash output Total 3 instances chunk Each hugh Mem ( k[0...63]) ……... a …….. h .
  • 14. Top Level ● Increment Nonce from 0 to 0xFFFFFFFF big_endian_32 SHA Algorithm Top big_endian_256 Cnt Compare with target Header Nonce PS ● If the value less than target then output ‘succeed’ signal ● else if cnt less than 0xFFFFFFFF increment cnt by 1 ● else output ‘fail’ signal
  • 15. Problems & Future Improvement ● Hardware is working in simulation but not working correctly with MemoryMap from C ● Data cannot be correctly read from the desired address ● Create a structural vhdl model that can take advantage of parallel calculations further Time management Task allocation
  • 17. Results & Evaluation SW miner hashrate: for 2329 hashes Zedboard (667 MHz): ~ 0.35 khash/s Laptop (i5, 2.50GHz): ~ 7.40 kHhWas Mh/isner If applied 667Mhz frequency. ~ 347 khash/s(192ccl for 1 hash)

Editor's Notes

  1. - to fairly compare - increase SW performance and for portability, migrate all software applications to Zedboard