-
slave_blocker
i have read a little about randomx.
-
slave_blocker
how can there be 2^256 possible programs that are run in the cisc architecture, and the verifying process of the nonce still be deterministic?
-
slave_blocker
so every single miner runs a different program to mine, and then for verification he not only sends the nonce, but also the parameters that define his program?
-
slave_blocker
in that case, there must be an aspect of randomx that makes it also impossible to use always the same program... that is awesome !?
-
WinslowEric[m]
<slave_blocker> "so every single miner runs a..." <- considering randomx is fundamentally a hash algo, the random program is surely determined by nonce.
-
slave_blocker
hum,
-
WinslowEric[m]
and other parameters that randomx received of course.
-
slave_blocker
so you are saying the output of randomx is a hash and a nonce? And the nonce fully determines the program used to mine?
-
WinslowEric[m]
Ehhh waht?
-
WinslowEric[m]
* Ehhh what?
-
slave_blocker
...
-
WinslowEric[m]
randomx is basically a hash algo, things like nonce and block data being hashed into a string. A random program execution is involved in the process of this hash.
-
WinslowEric[m]
for every input there must be a determined and expected output, otherwise it cannot be a proof-of-work algo, neither a hash algo
-
slave_blocker
i am translating ztm v2... and i would like to include randomx in it.
-
slave_blocker
regardless :
-
slave_blocker
This of course requires designing a syntaxless programming language (or instruction set) in which all random bit strings represent valid programs.
-
slave_blocker
exactly thats what does not make sense to me from the get go...
-
WinslowEric[m]
slave_blocker: What is confusing you?
-
slave_blocker
hum,
-
slave_blocker
lets say you and me are miners...
-
WinslowEric[m]
Determined string, determined program. But there is zillions variations.
-
WinslowEric[m]
s/is/are/
-
slave_blocker
you select a random program from the 2^256 possible ones. you mine the block with a nonce lets say 4 bytes long. then you find a block.
-
slave_blocker
then you say hurra.
-
slave_blocker
then you send block to me.
-
slave_blocker
then i say what programm did you use?
-
slave_blocker
the hash and the nonce alone are no good?
-
WinslowEric[m]
slave_blocker: determined by the nonce I use and the block data, you don't need to ask for that.
-
WinslowEric[m]
You can execute randomx with same data on your own to check it.
-
slave_blocker
ok
-
slave_blocker
but the nonce is just 4 bytes?
-
slave_blocker
how can it represent a value and a programm at the same time?
-
slave_blocker
what?
-
slave_blocker
hey what programm did you use?
-
WinslowEric[m]
slave_blocker: the nonce get translated into a program.
-
slave_blocker
answer: here take these 4 bytes and figure it out?
-
WinslowEric[m]
yes exactly
-
slave_blocker
wöojrnvüoawrbvwrnbvqrn
-
WinslowEric[m]
Random program exec is not the only section of the RandomX by the way.
-
WinslowEric[m]
slave_blocker: "syntaxless instruction set"
-
WinslowEric[m]
Any possible value for your 4 byte can be translated in a program
-
WinslowEric[m]
s/in/to/
-
slave_blocker
wait but thats only 2^32...
-
slave_blocker
where are the rest?
-
WinslowEric[m]
Remember, nonce is not the only data RandomX received, there is block data and hash from prev block.
-
slave_blocker
hum,
-
WinslowEric[m]
I think you need to read what does pow do again.
-
WinslowEric[m]
s/pow/PoW/
-
slave_blocker
+ 1 byte from the miner tx right?
-
WinslowEric[m]
-
WinslowEric[m]
Monero Block Template, don't worry about how many figures does randomx received
-
WinslowEric[m]
-
slave_blocker
i mean the miner has how many bits to construct his program?
-
slave_blocker
32 bits from the nonce + 8 bits from the extra field in the rcttypenull?
-
slave_blocker
i guess then the other ones are fixed.
-
slave_blocker
thats brilliant :)
-
slave_blocker
so there is a vector of 256 bits, 32 of wich are filled by the miner and the rest he does not control, so to say because they are hash values, that co-determine the nonce...
-
slave_blocker
that co-determine that vector ...
-
slave_blocker
?
-
WinslowEric[m]
kinda of, yes
-
slave_blocker
:)
-
slave_blocker
thanks so much
-
slave_blocker
im going to die a little less ignorant:)
-
slave_blocker
"syntaxless instruction set" ?
-
slave_blocker
so the program defined by these 256 bits is syntaxless?
-
slave_blocker
what does that even mean ?
-
slave_blocker
thats like saying :" unsorted phone book "
-
WinslowEric[m]
like... when you're programming, there are syntax right? x = y, brackets and things like that... RandomX used want to generate a "Abstract Syntax Tree" for random program exec, but that doesn't resist ASICs. So RandomX developed a method to transform digits into random programs, obviously no syntax in such digits. That's all
-
WinslowEric[m]
my fcitx service is broken again, need to reboot and back soon
-
slave_blocker
k
-
WinslowEric[m]
My GNOME is alive again, any question just ask =)
-
slave_blocker
holy shit so you are saying that every bit maps to an instruction...
-
WinslowEric[m]
not one bit one inst
-
WinslowEric[m]
but kinda similar
-
slave_blocker
well, in my opinion syntaxless instruction set sounds very french, very creme de la creme...
-
WinslowEric[m]
WinslowEric[m]: otherwise there would be only two possible inst lol
-
slave_blocker
no the bit at index i either maps at the instruction or not...
-
slave_blocker
i would not have coined it syntaxless though...
-
slave_blocker
however
-
slave_blocker
the more interesting question to me if i have understood it correctly is...
-
WinslowEric[m]
slave_blocker: i know nothing about french so i didn't get it. But I think what you
-
slave_blocker
under the set of definitions of randomx, yes every bit either maps to an instruction or it does not... if its a 1 it activates the instruction if its a 0 it does not?
-
WinslowEric[m]
* what you're thinking of is right
-
WinslowEric[m]
* i know nothing about french so i didn't get it. But I guess what you're thinking of is right
-
slave_blocker
but then...
-
slave_blocker
there is an infinite amount of possible definitions for randomx ?
-
slave_blocker
in other words there are 2^256 possible programs for randomx.
-
slave_blocker
ok next week someone comes along and defines that for the bit 202 -> to a diferent instruction, it gets audited by ostif and so...
-
slave_blocker
do you get my point?
-
WinslowEric[m]
not exactly...
-
WinslowEric[m]
Although I didn't fully comprehend your words, translation is not mapping.
-
slave_blocker
i mean the current implementation of randomx is just one out of infinitely many...
-
slave_blocker
These strategies of searching for programs of particular properties deviate from the objectives of this proof of work, so they must be eliminated. This can be achieved by requiring a sequence of N random programs to be executed such that each program is generated from the output of the previous one. The output of the final program is then used as the result.
-
slave_blocker
:|
-
slave_blocker
so verification is not O(1)
-
slave_blocker
its O(n)
-
slave_blocker
holy shit
-
slave_blocker
:)
-
WinslowEric[m]
w...what?
-
WinslowEric[m]
> These strategies of searching for programs of particular properties deviate from the objectives of this proof of work, so they must be eliminated.
-
WinslowEric[m]
[get completely confused]
-
WinslowEric[m]
verification is just simply compute the hash with same parameter to check if that hash does match, how could it be O(n)
-
WinslowEric[m]
there isn't even a "n"
-
sech1
-
sech1
there are 2^512 possible programs
-
sech1
not 2^256
-
sech1
also, define "n" in your "O(n)" estimation
-
sech1
verification is just simply calculating the same hash one time
-
sech1
if "n" is difficulty then verification is O(1)
-
hyc
the mapping of bits to instructions is somewhat arbitrary. a separate version of randomx could use a completely different mapping
-
slave_blocker
well i mean that there is here this chain of programs, only the output of the n-th program counts.
-
slave_blocker
so n refers to n programs in O(n)
-
slave_blocker
right hyc, at least that was what i was meaning :)
-
slave_blocker
what a rabbit hole ...
-
slave_blocker
-
slave_blocker
?
-
WinslowEric[m]
slave_blocker: I think I've got what you mean???
-
WinslowEric[m]
like, if you want to verify block 114514, you'll have to verify all of the hashes previous step by step?
-
slave_blocker
:|
-
WinslowEric[m]
That's the kernal of PoW, each block makes prev blocks stronger to alternations.
-
WinslowEric[m]
* That's the kernal of PoW, each block makes prev blocks more resisitent to malicious alternations.
-
slave_blocker
another question, since each nonce defines a program...
-
slave_blocker
is there some 2nd nonce that searches within that program?
-
slave_blocker
or is it one hash per program?
-
WinslowEric[m]
slave_blocker: yes
-
slave_blocker
?
-
WinslowEric[m]
?
-
slave_blocker
is it one hash per program?
-
WinslowEric[m]
yes
-
slave_blocker
wow
-
slave_blocker
i tried to run xmrig in an old server like 100 nm... it just seg faulted...
-
slave_blocker
I guess if the cpu does not have the instructions available it just crashes...
-
slave_blocker
so these are like instructions from the opcodes of the cpu? So these are assembler programs?
-
merope
Yes. If you go on a block explorer like xmrchain.net you can even look at the exact RandomX program that was executed within the winning hash for that block
-
merope
The node generated the block template from all the transaction data etc, the miner gets the block template, adds in their own nonce, then throws all this data into the RandomX hashing algo
-
slave_blocker
hum,
-
merope
Inside the hashing algo, that input data gets hashes via Argon2 and used to generate a bunch of data, which then is interpreted by a "virtual machine" as if it were an assembler program
-
merope
And then the output gets hashed again (iirc?) and that gived you the block hash for that specific nonce
-
merope
If this final block hash meets the difficulty requirement, then that nonce is considered "valid" and the block is added to the chain
-
merope
If it doesn't meet the difficulty, then the miner throws in a new nonce and starts over
-
slave_blocker
but i guess if i really wanted, and was able to, could i not just replace the missing assembler instructions with other ones? That take the same input and produce the same output...
-
slave_blocker
hum,
-
merope
No, because the instructions you have to execute are determined by that first round of Argon2 hashing
-
slave_blocker
what about that virtual machine... is it always the same or is it unique for each program?
-
merope
Whose output, in turn, is deterministically based on the input (ie the block template + the miner's nonce)
-
merope
The VM is always the same, and has a custom instruction set
-
merope
Which you can find in the design docs they linked you above
-
slave_blocker
yes...
-
merope
-
merope
On the left you see the RandomX program, written in its custom instruction set
-
merope
And on the right the corresponding x86 instructions, which is what it gets translated into when your actual physical cpu has to run it
-
merope
The hash verification is always O(1), because all you have to do is take the block template + nonce given to you and verify that the final result matches the block hash that was sent to you
-
merope
And all the operations are deterministic
-
slave_blocker
...
-
slave_blocker
since this should not be called hashing but rather programming...
-
slave_blocker
:)
-
slave_blocker
say a cpu is hashing over and over sha256, thats bad enough i know. And is this not even worse on the hardware not only is the cpu working as hard as it can for one task...
-
slave_blocker
But now it is running as hard as it can, and always distinctly !
-
slave_blocker
i guess divide is not used...
-
slave_blocker
this is totally baffling and i guess this would be a total overkill to explain in all its minutia in ztm...
-
slave_blocker
so if the nonce is 32 bits, i guess there are not 4 billion different opcode instructions in any cpu. How many diferent opcodes does randomx use ?
-
slave_blocker
no sorry!
-
slave_blocker
that was wrong...
-
slave_blocker
How many diferent opcodes does randomx use ?
-
slave_blocker
...
-
slave_blocker
why does random x use a vm at all?
-
WinslowEric[m]
to execute random generated program on things like x86 arm etc
-
slave_blocker
oh so its cross platform.
-
slave_blocker
is there a metamagik there too?
-
slave_blocker
or just because of cross-platform?