-
Isthmus
hmmm
-
Isthmus
test
-
Isthmus
s/test/monerobux meant to say s/test/monerobux meant to say s/test/monerobux meant to say
-
monerobux
Isthmus meant to say: monerobux meant to say s
-
Isthmus
s/s/s/test/monerobux meant to say test/monerobux meant to say test/monerobux meant to say
-
Isthmus
test
-
Isthmus
s/s/s/test/monerobux meant to say test/monerobux meant to say test/monerobux meant to say
-
Isthmus
@UkoeHB_ your github issue is a 3 course meal
-
Isthmus
Haven't finished it yet, but so far so good
-
gingeropolous
is there anything a bunch of GPUs would be useful for regarding monero development?
-
hyc
seems unlikely. GPUs are optimized for 16bit floating point math
-
hyc
using them for anything else is pretty weak
-
gingeropolous
well i didn't know if there's some math or stats or AI or something
-
hyc
AI accelerators on the market now are accelerating 8bit math
-
hyc
I guess a GPU can do that stuff, but precision is wasted
-
gingeropolous
yeah, but free infrastructure. except for me swearing at them.
-
UkoeHB_
knaccc I think my main objection to change address for Janus mitigation is scope creep. It requires 'baking in' the change address designation, effectively increasing the number of types of basic addresses: normal addresses, subaddresses, and now change addresses (integrated addresses don't really count, since it's just appending the ID to other addresses). My feeling is 8 bytes per tx is not too much a
-
UkoeHB_
price to pay to prevent the design scope from increasing. The 48+8 Janus mitigation does not affect what kinds of choices an implementer can make, it's just an extra step during tx construction, and an extra step during scanning.
-
knaccc
i'm not sure why you're classifying change addresses as a different kind of address. It's just a normal subaddress that you should never tell people about
-
knaccc
i'm always concerned about bloat on the non-pruneable part of txs
-
knaccc
and this 8 extra bytes would be non-pruneable
-
knaccc
i haven't done the math recently, but i'd expect 8 bytes means an approx. 5% increase in the non-pruneable part of the tx
-
UkoeHB_
It's a new classification since it's not interchangeable with other subaddresses
-
knaccc
what do you mean by "interchangeable"
-
UkoeHB_
You can't alter which subaddresses receive change for 2-out tx
-
knaccc
right, i guess what this fundamentally comes down to is that you've got a gut feel that it could be worth preserving the ability to segregate funds between subaddresses inside the same account, and i'm of the opinion that we've already decided that there should be no segregation because each account has a shared balance and we've already decided the wallet will spend funds out of any available
-
knaccc
subaddress
-
UkoeHB_
And it puts a burden on implementers to segregate change subaddresses from normal subaddresses, disallowing them from normal use
-
knaccc
my response to that is as follows:
-
knaccc
let's say you have an account
-
knaccc
it's already the case that when you send funds, you don't choose which outputs from which subaddresses will be spent
-
knaccc
and the funds could be spent out of multiple subaddresses within that account
-
knaccc
which means:
-
knaccc
1. the user is already expecting there to be no segregation within accounts
-
knaccc
2. there is no natural consistent place to put the change. if funds were spent out of subaddresses 3 and 4, does the change go in subaddress 3? or 4? or 0?
-
knaccc
so i'm saying we can bring consistency to this
-
knaccc
change always goes into -1
-
knaccc
i'm not sure how that could be considered a burden. it's a really simple rule
-
UkoeHB_
Ah, but to be clear: the account model is not 'baked in'. You'd more or less be canonizing the account model while creating a new classification of address.
-
knaccc
i'll take a second to dwell on what you just said, so i'm fully absorbing its significance
-
UkoeHB_
So you'd be moving from 'can do what you want' to 'this is how it must be'. Hence a burden on implementers to constrain how they may use subaddresses
-
maybefbi
how strictly does monero follow RFC 8032 for things like point addition or private key generation.
-
maybefbi
-
knaccc
maybefbi monero uses the exact same ed25519 stuff every other ed25519 lib does
-
UkoeHB_
It would be changing the design environment for implementers in the name of 8 bytes per tx
-
maybefbi
knaccc: which language has the best ed25519 library in my opinion for implementing things like blsag or other things mentioned in monero-zero-to-hero PDF?
-
maybefbi
*in your opinion
-
knaccc
UkoeHB_ it's gonna take me a while to ponder what you said fully.it does occur to me that for the first time in monero's history, the inclusion of a schnorr48 would be an acknowledgement that subaddresses exist at all, at the consensus/tx format level
-
knaccc
maybefbi if you're just playing with math, python maybe easiest. if you're building an app, choose whatever language the rest of your app is best coded in
-
UkoeHB_
The same could be said for how one-time addresses are constructed. Technically they don't need a tx pub key, but by moving the tx pub key to tx_supplement we are canonizing how addresses are constructed. Why do it? Since tx pub keys are non-optional. Likewise, being subaddress compatible is non-optional
-
maybefbi
knaccc: i tried to use golang's ed25519 to follow along monero-zero-to-hero but it doesnt have the right primitives. it uses things like extended homogeneous coordinates with cached coordinates and projected coordinates etc
-
UkoeHB_
You could try Rust and the dalek library
-
maybefbi
let me try dalek. THanks UkoeHB_
-
knaccc
maybefbi javascript might be the easiest way to get started. take a look at
github.com/knaccc/subaddress-js
-
maybefbi
i tried
pkg.go.dev/golang.org/x/crypto⊙v0…25519/internal/edwards25519?tab=doc but it is too opiniated and just for doing sign-verify as per RFC8032
-
maybefbi
it can add field elements, but not group elements
-
knaccc
maybefbi yeah some ed25519 libs only implement signing stuff and don't give you eveything you need. javascript 'elliptic' gives you everything you need
-
maybefbi
oh
-
knaccc
-
UkoeHB_
You could also try making your own primitives implementation based on the modular arithmetic, idk how much work that would be tho
-
maybefbi
i dont want to make a mistake. just want to understand the math high level
-
UkoeHB_
iirc sarang has a python library as well for crypto. Not at the computer atm
-
UkoeHB_
So a few options :)
-
maybefbi
sarang is sarangs' github username?
-
UkoeHB_
@SarangNoether
-
maybefbi
ah ok
-
maybefbi
thanks
-
maybefbi
will follow that lead too
-
UkoeHB_
Good luck and lmk if you have any questions/ find any errors :p
-
maybefbi
thanks a lot.
-
knaccc
UkoeHB_ let's say that some wallet software wanted to go down a different path to our current account/subaddress model. So, instead of having no segregation between outputs between subaddresses within an account, they wanted to have each subaddress effectively behave as a separate wallet. So each subaddress would be segregated, and an outgoing tx must use outputs only out of a single subaddress,
-
knaccc
and change must be returned to that subaddress. If we did have the extra 8 bytes, it would be straightforward, and they would be janus-protected. If we didn't have the extra 8 bytes, they'd have to segregate such that each segregated unit had two subaddresses: one for incoming funds, and one for change. And the change subaddress would not be shared, and they'd present things to the user as if
-
knaccc
there was only one address, even though technically change was going to a different incoming address. Or to put it another way, effectively they'd be creating an account for each user in their wallet, and would not have to reinvent anything. I'm struggling, in practical terms, to think of any kind of real world examples where leaving out the extra 8 bytes will tie the wallet software's hands.
-
knaccc
Perhaps you can think of some examples that I've not noticed yet
-
knaccc
to put the question more simply: can you think of any situations where the account/subaddress model could not be applicable?
-
knaccc
as another thought, i think there might be a fundamental difference in each of our sensitivites about whether an extra non-pruneable 8 bytes on a 2-out tx is a significant burden on tx size or not. I'm of the opinion that those bytes are very precious, and that we should not add extra bytes unless we absolutely have to. we should get others to weigh in on that narrow point
-
UkoeHB_
for example, in a marketplace where subaddress index corresponds 1:1 with product ID/payment order
-
UkoeHB_
that is probably true
-
knaccc
can you flesh out what the obstable would be, i'm not sure i understand the example
-
knaccc
osbtacle*
-
knaccc
lol obstacle
-
UkoeHB_
well anyone generating subaddresses for a vendor would have to: A) work around the change addresses while assigning subaddresses to new product/order IDs (possibly even skipping IDs, which could be confusing to users), and B) to spend money received to those subaddresses figure out how to properly direct change. I'd even expect some implementers to not understand the Janus mitigation, and end up
-
UkoeHB_
distributing change addresses publicly (perhaps not a threat to this example, but more generally implementers would be required to _understand_ the Janus mitigation on some level).
-
UkoeHB_
Are we at least agreed on: "You'd more or less be canonizing the account model while creating a new classification of address.", "It would be changing the design environment for implementers", and "implementers would be required to _understand_ the Janus mitigation on some level"?
-
knaccc
i still don't quite understand your scenario
-
knaccc
"anyone generating subaddresses for a vendor"
-
knaccc
what does that mean
-
knaccc
are you talking about someone providing wallets to vendors, so vendors don't have to have their own wallets?
-
knaccc
and in that scenario, wouldn't they assign an account per vendor, and then allow the vendor to have one or multiple subaddresses?
-
knaccc
i'm not sure why the account/subaddress model would not be suitable
-
UkoeHB_
I mean someone making a wallet useable by vendors
-
UkoeHB_
or integrated with some kind of marketplace for vendor useage
-
knaccc
ok, so what would be a reason that that wallet software could not use the account/subaddress model
-
UkoeHB_
Rather than any thinking about specific reasons, Im trying to point out that the implementation framework is changing
-
UkoeHB_
I don't have an objection to the account model, but _Im not an implementer_
-
UkoeHB_
so my opinion on it doesn't really matter
-
knaccc
i'm effectively saying that the account/subaddress model is so universally applicable, that there is no harm in tying ourselves to it
-
knaccc
and that no one should ever feel the need to reinvent the wheel there
-
knaccc
and so i see an extra 8 bytes as an insurance policy for the account/subaddress model turning out not to be universally applicable
-
UkoeHB_
ok, so long as we are agreed on the core question, then it will be clear for others what they need to evaluate
-
knaccc
i do sympathize with the abstract principle you're putting forth
-
knaccc
i'm predisposed to a much more concrete rather than abstract way of evaluating things i guess
-
knaccc
and i also take into consideration that if the 8 byte insurance policy needs to be invoked, it can be invoked either by having it in place now, or by simply introducing it in the future
-
knaccc
and a future introduction could be done without consensus changes, since it could just be added to txextra if wallets ever decide that it was a mistake to not include it
-
UkoeHB_
also on a related topic, apparently the average output count is 2.2, and that extra 0.2 refers to tx with >2 outputs; 0.2*48 = 9.6 bytes (additional Schnorr signatures per output), and 0.2*32 = 6.4 bytes (additional tx pub keys per output assuming no additional tx pub keys currently, let's assume for argument it's around 1/2 so 3.2 bytes average increase from mandating 1tx pub key per output for >2 outs)
-
UkoeHB_
so about 13 bytes average increase above the 2-out consideration
-
knaccc
interesting
-
scoobybejesus
If I may dumb things down with an analogy, imagine that Monero is a software for letting an author write books. It allows the author to have a hierarchy of books, chapters, and pages, and that's it. Some authors come along and say "hey, I can't write a book without sub-chapters; how hard can it be to add? please add this feature." Monero says "no, believe it or not, the extensibility isn't worth the
-
scoobybejesus
technical debt and loss of the current clarity/simplicity, in our opinion." Well, that's the actual story of the open source BookStack web app, and book/chapter/page is mostly analogous to our wallet/account/subaddress. And that opinion is what it appears you're trying to converge on. Hopefully this parallel triggered a light bulb for someone
-
UkoeHB_
Hm if I understand it right, the question is whether to mandate sub-chapters or not.
-
UkoeHB_
Maybe not a perfect analogy
-
knaccc
i do get the gist. it's the perpetual question of whether we need to offer future flexibility, and flexibility generally often comes with a cost
-
scoobybejesus
not mandate. allow. the point is they have a rigid structure. i say "they" but it's a single maintainer, so much easier to reach "consensus."
-
knaccc
here is another way to go about things: instead of saying "do we really need those 8 bytes", maybe we should be asking whether we need to add not only those 8 bytes but more
-
UkoeHB_
is 16 bytes the limit for reducing the challenge hash? e.g. could we go down to 8 bytes for the Schnorr? sarang ?
-
knaccc
so the 8 bytes are there to prove that we were the ones that sent the transaction that is returning change to us
-
knaccc
maybe we should take this opportunity to not only prove we sent the tx, but also to indicate to ourselves which outputs were spent
-
knaccc
and thus solve the "view-only balance is wrong" issue
-
knaccc
(although not solving the "funds were stolen but the view-ony wallet couldn't tell" issue
-
knaccc
UkoeHB_ i'm fairly sure we need to stick to 128 bits for the hash
-
knaccc
because that can be brute forced without spamming txs
-
UkoeHB_
you'd just need an extra 1 byte to encode the index
-
knaccc
maybe we need 1 byte per input spent in a tx, to indicate the spent output, and encrypt that with the private view key
-
knaccc
the only objection is that people might rely on the view-only wallet to know if their funds have been stolen
-
knaccc
but i think it's worth the byte to make view-only wallets more useful
-
UkoeHB_
hm it seems like to brute force 8-byte challenge you'd have to test on the order of 1e17-1e18 scalar-mult-keys (or scalar-mult-base), since all you could do is figure out all the possible tx private keys and then test them against a selected base for the listed tx pub key; it wouldn't be enough to find a collision for the hash
-
knaccc
i guess if there are 17 real inputs being spent, we could encode more compactly. we look at the number of inputs, go to the next power of 2 and decide how many bits required to encode the real index of each input in the ring, and use only as many bits as required per ring. then pad to the next byte boundary
-
knaccc
yeah the scalarmult does mean the hash could be less than 128 bits i guess
-
knaccc
i wonder how many bits that scalarmult buys us
-
knaccc
i think it allows us to maybe reduce it at most from 128 bits to 110 bits, so only 16 bytes to 14 bytes roughly
-
UkoeHB_
based on?
-
knaccc
based on a 0.25ms scalarmult compute time
-
knaccc
and a 2ghz processor with one core
-
knaccc
these are very rough and wildly inaccurate approximations
-
knaccc
i just assume one instruction per cycle
-
knaccc
so log_2 of (.25e-3)*2e9 is 18.9 bits
-
knaccc
that's with the assumption though that one hash is one cycle, and that's not true
-
UkoeHB_
I think we could reduce the change tag to 6 bytes, which is 2.8e14 domain space (280 trillion)
-
UkoeHB_
even with 1mill outputs the chance is 1 in 280million to guess
-
knaccc
what would be the objection to simply adding the change tag to the txextra if some future wallet implementation has some unforeseen reason to need it?
-
knaccc
if could put it in some future encrypted memo space that might be introduced into the future, to not affect tx uniformity
-
UkoeHB_
that wallet would be implementing it selfishly, and it would become difficult to get other wallets to update
-
knaccc
but i don't think that's possible
-
knaccc
because the change tag is only useful when a wallet sends funds outbound
-
knaccc
it doesn't matter if there is only one running instance of that alternative wallet in the world
-
knaccc
it doesn't need any other wallets to use the change tag
-
knaccc
it's only useful for the wallet to put on its own txs if it finds it useful
-
knaccc
so the only argument against making the change tag optional is tx uniformity
-
UkoeHB_
well other wallets would now have to start adding the tag to be compatible with the unorthodox wallet, which may cause some drama/etc
-
UkoeHB_
not adding, reading the tag
-
UkoeHB_
and that other wallet would have a harder time reading orthodox wallets if they are using the change address for some other purpose
-
knaccc
"well other wallets would now have to start adding the tag to be compatible with the unorthodox wallet" < that's not true
-
UkoeHB_
I meant reading
-
knaccc
we already know how to put extra txextra tags that wallets ignore
-
knaccc
you just ignore unknown txextra tags
-
UkoeHB_
right, but if someone transferred their keys to another wallet it wouldn't be able to read the change tags (unless updated)
-
knaccc
but if someone was using a wallet that threw away the account/subaddress model, they wouldn't expect things to make sense when restoring with a standard wallet
-
UkoeHB_
well it would certainly make even less sense
-
knaccc
i guess i'll take back some of my last sentence
-
knaccc
i can see your point that it would make more sense if change tags were universally adopted
-
knaccc
yeah i think then we're back to "i can't imagine a scenario where accounts/subaddresses aren't universally applicable, and if we do realize a shortcoming, we can always introduce change tags when we understand how they can be useful"
-
knaccc
so the point of the insurance would be if we don't think the tx format will be evolving such that we can easily add change tags in later
-
knaccc
if we assume that things like triptych or other future changes are inevitable, then adding change tags when we understand a real world application for them sounds very easy
-
UkoeHB_
there may be some centralization objections there, i.e. relying on the core team to permit/enable innovations
-
knaccc
yes
-
knaccc
although not in this case, i'd argue
-
knaccc
because all of this could be implemented in txextra instead
-
knaccc
and the marketplace could decide whether they wanted to use wallets with view tags and change tags and schnorr48s etc
-
knaccc
there is a broader point here, that you've identified
-
knaccc
which is, if a wallet e.g. doesn't support addresses that start with a 4 or an 8, can that really be called "monero"?
-
knaccc
there is no reason that wallets need to use base58 addresses
-
knaccc
they could use base64
-
knaccc
i think the reality is that we're going to have to always look for consensus on what "monero compatible" really means
-
knaccc
and that'll bleed into all sorts of things that aren't anything to do with the tx format or consensus protocol
-
knaccc
just for completeness: the proposal is currently that, given m=Hs(a || account index || subddress index), change is sent to subaddress index -1. As an alternative, if we deemed it valuable to preserve subaddress balance segregation within accounts, we could make it so that for every subaddress m there is a change address m_change=Hs("change" || a || account index || subddress index).
-
knaccc
and wallets would simply consider change to be part of the corresponding subaddress balance
-
UkoeHB_
updated proposal part 2, hopefully it captures all the salient points
-
knaccc
UkoeHB_ thanks for all the hard work in writing this stuff up. couple of quick things:
-
knaccc
"Implementation complexity will rise as implementers will be required to comprehend the Janus attack on some level"
-
knaccc
It'd be useful i think to make clear that you're talking about people writing their own Monero wallets, rather than implementers in the sense of people using a monero wallet
-
knaccc
and secondly, "Note: @knaccc argues change addresses could be used initially, then we could switch to change tags if they seem more reliable/better." -> i do agree with what you noted about " I am concerned about technical debt from change tags"
-
knaccc
so if it came across that way, i withdraw the argument that it is a simple win-win where you can not have change tags now, and introduce them in the future
-
knaccc
so really my argument is that we've already gone down the path of introducing the concept that users should not expect there to be output segregation between subaddresses belonging to the same account, and have told users that having multiple accounts within a wallet is the correct way to segregate balances. therefore i see the no-change-tag-required option as a natural followon from that
-
knaccc
approach, and we can add change tags later if we later discover that it provides any compelling additional flexibility
-
knaccc
and of course i welcome anyone to suggest compelling possibilities that I have not currently have had the imagination to consider
-
knaccc
you're totally right that people writing wallets will need to know what a janus attack is
-
knaccc
but then, if they're writing a monero wallet, and they don't know what a janus attack is, then they're also ignoring the schorr48
-
knaccc
and they'll also ignore the change tag
-
knaccc
if i had misinterpreted you and you really did mean implementers in the sense of people using the monero wallet, then i'd advocate for dropping the ability of users to direct change to particular subaddresses
-
knaccc
(although allow direction of change to different accounts)
-
UkoeHB_
There is a possibility of wanting to segregate within accounts even further. I also have a vague idea there could be utility to controlling which specific address gets change outputs, e.g. some kind of key management scheme where a bunch of outputs must go to the same exact address. Just spitballing, since imo the current system isn't constrained enough for adding change outputs to be a neutral change
-
UkoeHB_
Well there may be people forking the core wallet to implement their own address related schemes
-
UkoeHB_
And a new implementation would have to take into account 48-byte and change tag since they are stuck in the tx structure
-
derbleak
Possible that Janus could be mitigated through tx uniformity. Make all txes the same size (set at some reasonable limit), and could include in that tx proofs/tags/whatever or dummy padding for smaller txes
-
UkoeHB_
So it basically forces all possible implementers to deal with it
-
UkoeHB_
By having change tag
-
derbleak
thinking along the lines of how mixnets defeat traffic analysis attacks with uniform packet length/format
-
UkoeHB_
derbleak: I think that would entail way bigger tx, like 20x bigger
-
derbleak
yes, it would be *very* space inefficient
-
derbleak
but a huge gain in privacy, iiuc or it actually works
-
UkoeHB_
And here knaccc and I are squabbling over 6 bytes :p
-
derbleak
may be not worth the tradeoff
-
derbleak
right
-
derbleak
:)
-
derbleak
but the concept may apply in the future, or when space per tx is not a huge concern
-
derbleak
currently agree, the chain would bloat to becoming unusable atm
-
UkoeHB_
I suppose if unexpectedly petabyte thumb drives become commonplace then we could go wild with memory consumption
-
» derbleak pulls out their exabyte thumb drive
-
derbleak
:p
-
derbleak
could potentially archive the uniform tx separately, with a witness chain similar to segwit, but then we are talking *huge* architectural changes
-
derbleak
anyway, tangent over, just wanted to put it out there
-
knaccc
btw despite the implementation pain, there is a certain sense of correctness to the idea that shared secrets with strangers should happen using asymmetric means, and shared secrets with yourself should be achieved via symmetric means
-
knaccc
and that therefore you shouldn't be diffie helmanning with yourself
-
knaccc
for the change outputs
-
knaccc
i agree though that simplicity trumps the notion i just described
-
derbleak
knaccc: so smth like a HKDF for self-secrets, DH for shared w/ others?
-
knaccc
derbleak yeah, so specifically in this case, an output is Hs(rA||i)G+B when sending to others, but Hs(private view key || txpubkey || i) for change to yourself
-
knaccc
Hs(rA||i)G+B vs Hs(a||R||i)
-
knaccc
Hs(rA||i)G+B vs Hs(a||R||i)G+B
-
knaccc
or even skip the mult with G and make an output A'+R+iG+B for change outputs, where A' is a secret known only to the person with the private view key, calculated as A'=Hs("my secret ec point"||a)G
-
knaccc
actually that doesn't work unless you remember your choice of random r
-
knaccc
heh we really need to get lots of people to weigh in with opinions and considerations we may have missed, or we're gonna go crazy :)
-
knaccc
i think we'll probably come to a consensus pretty quickly once the discussion is opened up
-
derbleak
will definitely keep thinking about Janus, and re-read the discussion up until now
-
derbleak
hopefully nothing too moronic flows through my keyboard :p
-
knaccc
my mind can be changed on this incredibly rapidly through some potential use cases that would be hindered by -1 subaddresses
-
derbleak
-1 mod p, or negative index?
-
» derbleak new to the discussion
-
knaccc
as in the subaddress 0003FFFF for the -1 subaddress in the fourth account in a wallet
-
knaccc
oops i meant 00000003FFFFFFFF
-
derbleak
ah, so -1 in the normal sense :)
-
knaccc
yeah, and actually i really meant 03000000FFFFFFFF since it's supposed to be two little endian uint32s
-
derbleak
why not just invalidate xxxxxxxxFFFFFFFF?
-
knaccc
i don't understand
-
knaccc
to achieve what?
-
derbleak
o, thought that was causing the Janus issue, or contributed to it
-
knaccc
no
-
derbleak
then nvm
-
derbleak
option 4 for mitigation sounds the most compatible (tags + schnorr-48)
-
derbleak
agree w/ knaccc about not including integrated address stuff in any new tx schemes