Bitcoin Forum
September 19, 2025, 09:39:01 AM *
News: Latest Bitcoin Core release: 29.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 [2]  All
  Print  
Author Topic: Mechanical hashing  (Read 560 times)
darkv0rt3x
Hero Member
*****
Offline Offline

Activity: 1288
Merit: 682


I rather die on my feet than to live on my knees


View Profile
June 28, 2022, 10:03:49 PM
 #21

Quote
Is anything like that, people is talking about here?
Well, there is one main requirement: it should require no external power supply. If there is power outage, that device should still work. Someone proposed chemical hashing, I thought more about mechanical hashing, because it seems to be easier to compute than using paper and pencil, and it should be easier to learn, how to operate that. I thought about something simple, like constructing some tables for basic operations, like addition, rotation, xor, then it could be possible to compute hash functions manually, just by rotating a crank, or providing needed energy to the system in other simple ways. For example, it could be possible to paint squares in different colours to represent zeroes and ones, then negating the whole number could be done by simply rotating some wheels inside it by 180 degrees.

I thought about many different ways of doing that, but it seems some mechanical engineer is needed to make it real. It could use some buttons, some magnets, some rotating wheels with hex digits from "0" to "f", there are many options. Each state can be represented in many different ways, you could also place something here, like a marble (when it is present, it could represent "logical one", and when it is empty, it could represent "logical zero"). It could use gravity to implement logical gates. I don't know exactly how to make it, because I didn't find anything like that anywhere, maybe just nobody needed it yet.

To put it simply, it should be better than paper and pencil, and should work in cases, where no electricity is available, or if there is power outage, that's the general idea behind it. And I think making it in a mechanical way would be the simplest solution to that, but maybe there is something better available, I don't know (but I am not convinced for example to the chemical solution, that could be hard to do in a typical home, I think building a physical machine, or passing a ready-to-assemble project for some manufacturer, would be easier).

Edit: some visualization, how it could look like: https://upload.wikimedia.org/wikipedia/commons/4/44/Grant_mechanical_calculating_machine_1877.jpg
Of course it is just an example, because hash functions are more complex than that.

Well, I don't even have all the knowledge present in memory to at least make a mental sketch of what would be needed. I am an electrical engineer but I am not even close to be able to put up something like this. This is something probably to be put up as a project with several stages an probably multiple teams working on each stage! Or someone really bright/smart/intelligent capable of pulling this off alone! I'm not that one for sure!

You need to know exactly about bits and bytes, cryptography, probabbly mechanical engineering, learn or find someone to design components in 3D software with great precision, think about probably thousands of details in each stage of the project etc.

If you are really into this, maybe we should start by making a statement and say: I have this goal. I want to do this and that. Whoever is interested and whoever has any type of skills, feel free to onbard. After that, we would need to start laying down the stages, tasks for each stage, what knowledge and skills are needed in each stage, etc. I can't see this done by simply throwing ideas in the air like we are doing!

If this machine is anything like the Turing machine, I can't imagine how many thousands of hours were spent by those 2 guys and probably by a bunch of other unknown people in the background!

Check this thing: Enigma machine used by Germans to encrypt messages
https://www.youtube.com/watch?v=G2_Q9FoD-oQ

xD

And then check the craking machine here, at aroun 5:30. Machine Turing built to decrypt Enigma machine encryption!
https://www.youtube.com/watch?v=Hb44bGY2KdU

Bitcoin is energy. Bitcoin is freedom
I rather die on my feet than living on my knees!
larry_vw_1955
Sr. Member
****
Offline Offline

Activity: 1190
Merit: 470


View Profile
June 29, 2022, 01:13:50 AM
 #22


Check this thing: Enigma machine used by Germans to encrypt messages
https://www.youtube.com/watch?v=G2_Q9FoD-oQ
a mechanical sha-256 hashing machine would probably be more complex than this enigma thing.  keep in mind too that the enigma was not purely mechanical. it was really electronic in nature.
Cricktor
Legendary
*
Offline Offline

Activity: 1260
Merit: 2973



View Profile
June 29, 2022, 05:19:27 AM
 #23

The electrical part of the Enigma was purely used for current flow to highlight the result of the purely mechanical change of rewirering of characters. The encryption process ie. the change of character to character wirering is completely mechanical.

larry_vw_1955
Sr. Member
****
Offline Offline

Activity: 1190
Merit: 470


View Profile
June 29, 2022, 10:04:06 PM
 #24

The electrical part of the Enigma was purely used for current flow to highlight the result of the purely mechanical change of rewirering of characters. The encryption process ie. the change of character to character wirering is completely mechanical.
yeah but the electrical part was how it operated. based on making and breaking different circuits. if the battery ran out of juice there is no way that thing would have operated.
darkv0rt3x
Hero Member
*****
Offline Offline

Activity: 1288
Merit: 682


I rather die on my feet than to live on my knees


View Profile
June 29, 2022, 10:05:58 PM
 #25


Check this thing: Enigma machine used by Germans to encrypt messages
https://www.youtube.com/watch?v=G2_Q9FoD-oQ
a mechanical sha-256 hashing machine would probably be more complex than this enigma thing.  keep in mind too that the enigma was not purely mechanical. it was really electronic in nature.


Yes, I know. I just wanted to have an idea if these hashing machine would be anything like that concept of the Enigma machine! Other than that, yes, it would probably be even more complex as the mathematical processes that take part in the hashing functions are also complex (I have the idea, not the actual knowledge).
So, this said, and as I also said, to pull something like this out, we would need multiple people thinking, writing, modeling parts, drawing parts, manufacturing parts, not to even mention all the theoretical part before all the hardware work, right?

Bitcoin is energy. Bitcoin is freedom
I rather die on my feet than living on my knees!
larry_vw_1955
Sr. Member
****
Offline Offline

Activity: 1190
Merit: 470


View Profile
June 30, 2022, 02:14:08 AM
 #26

So, this said, and as I also said, to pull something like this out, we would need multiple people thinking, writing, modeling parts, drawing parts, manufacturing parts, not to even mention all the theoretical part before all the hardware work, right?
Well it seems like the key thing would be to break this device down into functional subunits that each performs a certain type of task. like XOR, AND,Rightrotate, + mod 2^32. then you can manufacture these subunits in quantity and assemble them into larger subunits that perform any general task.
vjudeu (OP)
Copper Member
Legendary
*
Offline Offline

Activity: 909
Merit: 2331


View Profile
June 30, 2022, 06:10:54 AM
 #27

Quote
+ mod 2^32
It is simpler than you think. If you can implement addition, getting it modulo 2^32 means simply rejecting the highest bit. And addition can be handled just as a combination of XOR and the majority function. First, you use the lowest bit from "a", the lowest bit from "b", and zero as a carry, and execute a XOR on that to get the lowest bit of the result of addition. Then, using the same input, you execute the majority function: if there are at least 2-of-3 bits set to one, then there is a carry equal to one, otherwise zero. And you can go through it bit-by-bit, then you can save the last carry, if you want to produce 33-bit result for your addition, or just skip it, and then you will have it modulo 2^32, just by dropping one bit.

Another thing is that "modulo addition" and "modulo subtraction" is like rotating a clock: if you have modulo 60, then you can represent seconds. If you add 45 and 50, then you will get 95, but modulo 60 it will be 35. So, modulo addition is like rotating a huge wheel, where after 0xffffffff, you will get 0x00000000 (and the same in the opposite direction is true when you have subtraction). So, I can imagine for example 8 wheels with numbers from 0 to f, when they can be rotated to handle addition, and when each next wheel will tick only when the previous one was rotated by 360 degrees, and jumped from "f" to "0".

Quote from: satoshi
I've moved on to other things.
kriptokojn
Newbie
*
Offline Offline

Activity: 3
Merit: 1


View Profile
December 14, 2024, 07:04:18 PM
Merited by vapourminer (1)
 #28

To explain better, how crypto works, for less-technical and less-digital people, there is a need to explain hash functions mechanically, without involving any electricity. I think it should be technically possible to make a mechanical device, where any user could set any Initialization Vector for SHA-256, set any 512-bit message, and see the result of hashing this block once by SHA-256. That could be used to better explain, how mining works. If someone will make something like that, I will buy it for Bitcoin. I saw some interesting projects here, maybe this idea could inspire someone to make something like that for some hash functions, for example SHA-256.

hey man, I created a prototype for exactly this thing, if you're interested read here:

https://substack.com/home/post/p-151596504

it's a pen & paper prototype but I envisioned it as a mechanical device where the spirals are rotated and the 1s and 0s are something like rotating beads that have one side black and the other white, or something like that, it could be done in a number of ways, but the bottomline is all you have to do is have the input vector written down somewhere and then to feed it word by word (32-bit word) into the "outer edge" part of the spiral as you go through the hash algorithm

there is also a separate process through which one calculates the w16-w63 parts of the input vector using the same setup without overwriting the current state of ABCDEFGH values

I'm currently testing the paper prototype to see if I can perform a hashing of the full block, it's pretty tedious with pencil & paper but with a mechanical version and knowing the process by heart (and practicing it) I think it can be done pretty quickly in human terms - like currently I need like 1 hour per 1 round of hashing, I think it can be reduced a lot with some mechanical engineering and pure muscle memory Smiley
NotFuzzyWarm
Legendary
*
Offline Offline

Activity: 4130
Merit: 3255


Evil beware: We have waffles!


View Profile
December 15, 2024, 01:00:17 AM
Last edit: December 15, 2024, 03:10:47 AM by NotFuzzyWarm
Merited by vapourminer (1)
 #29

I don't see it as thing much more complicated than how the original mechanical pull-the-handle tabulators/comptometers worked. They could add, subtract, multiply & divide. Just need more entry keys and associated mechanisms along with a register to hold intermediate results and apply them to the next sequence of the math. Considering they were 1st built back in 1887 and made thru the mid 1970's, odds are that there are old mechanical drawings of their mechanisms *somewhere* on the web.
Quote
Although the comptometer was primarily an adding machine, it could also do subtractions, multiplication and division. Its keyboard consisted of eight or more columns of nine keys each. Special comptometers with varying key arrays were produced for a variety of special purposes, including calculating currency exchanges, times and Imperial weights. The name comptometer was formerly in wide use as a generic name for this class of calculating machine.

- For bitcoin to succeed the community must police itself -    My info useful? Donations welcome!  3NtFuzyWREGoDHWeMczeJzxFZpiLAFJXYr
 -Sole remaining active Primary developer of cgminer, Kano's repo is here  Discord support invite at https://kano.is/
-Support Sidehacks miner development. Donations to:   1BURGERAXHH6Yi6LRybRJK7ybEm5m5HwTr
kriptokojn
Newbie
*
Offline Offline

Activity: 3
Merit: 1


View Profile
December 15, 2024, 10:51:11 AM
 #30

I don't see it as thing much more complicated than how the original mechanical pull-the-handle tabulators/comptometers worked. They could add, subtract, multiply & divide. Just need more entry keys and associated mechanisms along with a register to hold intermediate results and apply them to the next sequence of the math. Considering they were 1st built back in 1887 and made thru the mid 1970's, odds are that there are old mechanical drawings of their mechanisms *somewhere* on the web.
Quote
Although the comptometer was primarily an adding machine, it could also do subtractions, multiplication and division. Its keyboard consisted of eight or more columns of nine keys each. Special comptometers with varying key arrays were produced for a variety of special purposes, including calculating currency exchanges, times and Imperial weights. The name comptometer was formerly in wide use as a generic name for this class of calculating machine.

hi, I love these in terms of archaic low-tech fallback systems

the problem with these though is that they were built from bottom to top for general purpose

there are a lot of optimizations by building top-to-bottom is you make a task-specific machine (think mechanical ASIC, as I write in my linked substack post above perhaps jokingly but not so far from the truth)

for example, in my case of this spiral hashing system I developed over the last 5+ years, instead of rotating a binary string to the right »6, right »11 and then to the left »25, we do the rotation of clockwise »6, then »5 and then counter-clockwise «2, while just keeping track of the mean-result of the XOR

similar things are happening with calculating the w16 part of the input based on the block header, where instead of doing rotations to the right »16, right »17 and then a shift to the right »10, you're doing this algorithm:
- if not in the last 10 bits (which corresponds to the last 10 bottom segments of the spiral), then do: right »6, left »7, left »2
- if in the last 10 bits, then do: up »0, left »1, left »2
- each first rotation to the (right ») requires you to simply "change floors" of the spiral (which equates to changing from the higher order part of the binary string to the lower order part, or vice versa)

I believe this system is a great start for buliding such a machine, which is why I spent so much time on it. it could most likely be optimized even more, but so far its' just me working on it, and I am most definitely not the brightest of minds that can be found in this area

edit: the optimizations I mention are in the amount of work a human or mechanical device needs to do, think more in "joules" and less in high-level lines of code
Pages: « 1 [2]  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!