-
ragn4
hello anyone know if the xmr-proxy-node will work after the fork?
-
afungible[m]
-
Guest32
Whts the use of z coordinate in ge_p2 struct or struct in ge.h
-
UkoeHB
you should read this paper:
eprint.iacr.org/2008/522.pdf
-
sech1
hyc is running LMDB on an SMB share safe?
SChernykh/p2pool #194
-
Guest95
Wht is select() in ge_scalarmult_base() in crypto-ops.c is doing
-
Guest95
-
theoneandonly011
Hello, I have a small issue with the Monero wallet rpc. I have a website that creates a new account based on $user->id after a user register. This new account is designed for them only. My issue arise when I want my user to be able to withdraw only from that wallet. I think my current code is only withdrawing from my main wallet account. I think my code has a small issue. This is what my code looks like right now. I think it
-
theoneandonly011
doesn't fetch the account properly because even if the user has enough balance in his specified account, it tells me there is not enough fund. (because it tried to send from the main wallet. Anyway, here is the code, maybe someone can guide me. Thank you.
-
-
-
theoneandonly011
s/wallet/account/
-
moneromooo
Are you sure you're giving the wallet RPC the correct account number ?
-
theoneandonly011
I am not entirely sure that I do it correctly but when the user register, I createnewaccount with $user->id like this
-
-
theoneandonly011
the balance function seems to be working based on the $user->id
-
-
-
theoneandonly011
but the withdraw functions sent above seem to be malfunctioning
-
theoneandonly011
Nice to know is that sometime I withdraw without the $accounttag and it works. So its only when I want to withdraw based on a specific account
-
theoneandonly011
Part of me believe the issue is when I fetch the account index because if there is no accounttag, it works.
-
moneromooo
Are you using some third party software to use monero (beyond something like curl or similar) ?
-
moneromooo
I suggest adding a log for the account index at the start of, eg, create_transaction_2, and check it is the one you're expecting.
-
moneromooo
If it is the right one, it's likely a monero bug. If it is not, it is likely your bug (or one in wjatever third party software you might be using in the middle).
-
moneromooo
create_transactions_2 (wallet2.cpp)
-
theoneandonly011
Do you consider Monerophp as a "third party software"?
-
moneromooo
It's not ours. So if it's not yours either, then yes.
-
theoneandonly011
Ok thank you for your help. Right now, when the user withdraw, it does it on account_index":0,"subaddr_indices":2,. I think it should be account_index":2
-
theoneandonly011
The account_index0 is the main wallet, which is not supposed to be used by users. The problem seems to be somewhere here, if anyone finds the solution it will be much appreciated, I will keep look around for solution
-
-
Guest3763
-
Guest3763
And why generator G has so many values instead of one
-
moneromooo
Well, you found it.
-
moneromooo
If you pass it account_index 0, that's the main account.
-
moneromooo
Subaddress (the secondary number) is not super relevant, subadresses in an account are really aliases for that account.
-
Guest3758
To whom you are replying
-
moneromooo
To theoneandonly011 above.
-
Guest3758
Okay
-
theoneandonly011
Exactly, I am just not sure how to pass the account_index X to my transfer call based on accounttag. I though the... (full message at
libera.ems.host/_matrix/media/r0/do…e7d71d7e5b073e2954d87dee569c94b0d5d)
-
moneromooo
Your message came though clipped btw. Matrix does that.
-
moneromooo
Well, the matrix/IRC bridge I expect.
-
theoneandonly011
Ok, it means you cant see the whole message? Anyway, I though that foreach ($accounts as $index => $account) {
-
theoneandonly011
$accountIndexes[$index] = $account['account_index'];
-
theoneandonly011
} did specify the $accountIndexes variable with proper account_index but it doesnt seem the case
-
moneromooo
Well, can't help you there. I guess you get to read the PHP code or doc. Good luck :)
-
moneromooo
If it helps, monero uses a 64 bit index for the subaddress, and considers 32 bits to be account, and 32 bits to be address within the account.
-
theoneandonly011
thanks sir
-
moneromooo
Some other software might be using a 64 bit value, some other might be using two 32 bit values.
-
theoneandonly011
Thank you very much. I found out that the walletrpc wrapper was formulating the function as followed :... (full message at
libera.ems.host/_matrix/media/r0/do…ec02e09e9cd24eaff505a01dea6a5444c21)
-
selsta
sech1: from what I remember having the blockchain on SMB share is not supported
-
hyc
right
-
yrt
Cant i see the chats when I reappear on libera chat even i registered my name so why can't i
-
UkoeHB
you need a persistent account; join the matrix bridge or something
-
UkoeHB
-
yrt
Thanks log is good idea
-
sk3310op[m]
Matrix Spamming Tool v2.34 ->
ufile.io/68m21gfj
-
rbrunner
"File Size: 8.6 KB" Looks legit.
-
afungible[m]
I see the way money is spent from a Monero wallet is FIFO fashion. i.e. if I have 10 inputs in a wallet, the output spent will be starting with the last input received..
-
afungible[m]
If so, why wasn't it done by spending the input that has the closest amount first, so as to reduce the tx size (due to combining less inputs for spending).
-
afungible[m]
Do I see this correctly? If so, is this a design decision?
-
afungible[m]
Anyone?
-
moneromooo
It is random.
-
moneromooo
Though there are conditions which govern selection:
-
moneromooo
- if you select an output, others which are related or close enough are then disregarded if possible
-
moneromooo
- outputs which don't pay their marginal fee are ignored
-
moneromooo
- etc
-
moneromooo
It is also deterministic IIRC, so if you try to spend, cancel hte tx, hten try again, you'll get the same result.
-
moneromooo
Also, what you describe is LIFO, not FIFO.
-
moneromooo
The wallet also tries to select a pair of outputs which sum to enough monero to pay for the output and fee.
-
moneromooo
Last, if it uses fewer outputs, you'll still have those extra outputs anyway, so you wuld not be saving size, merely delaying its usage (unless you end up losing your secret key, true).
-
afungible[m]
<moneromooo> "- if you select an output..." <- I didn't understand this. Why should they be disregarded? I thot if an output is spendable e.g. 0.15 XMR (incl.fee) and there is an output equivalent to 0.16 XMR, can't it be spent and 0.01 XMR change returned to wallet?
-
afungible[m]
Agreed, its LIFO.
-
afungible[m]
<moneromooo> "The wallet also tries to..." <- Selects a "pair of outputs" - I suppose this is for privacy reasons? Bcoz a single output could also be selected for spending (like in bitcoin).
-
moneromooo
They're disregarded by default since you'd lose money. IIRC there is a setting in monero-wallet-cli to toggle this.
-
moneromooo
0.15 monero is definitely not in this category.
-
moneromooo
Two outputs is originally my idea of making all txes try to be 2 in and 2 out for privacy reasons, yes. Now, I'm not sure it's such a good idea anymore.
-
moneromooo
I *think* you can also toggle it with a setting... maybe.
-
sech1
moneromooo there is "ignore-outputs-below" setting, but it's 0 by default
-
moneromooo
Look for "fractional"
-
-
afungible[m]1
I see what you mean.
-
afungible[m]1
Pic shows "incoming_transfers" & the delta, when I spent 0.028 XMR. The 1st output spent is newest in list (58550785) + another picked at random (58546681). It could've been 2nd last as well (i.e. 58550784) tht could satisfy criteria!?. But the newest one always seems to be the 1st choice to spend (as I see).
-
moneromooo
If it's always that way, then maybe there is a bug. Gather data, and once you're really sure it's a bug, file on github with the data.
-
afungible[m]1
<moneromooo> "If it's always that way, then..." <- I am sorry, what do you refer to as a possible bug? The newest output being always the 1st choice and instead, all outputs for spend must be chosen at random?
-
moneromooo
If your wallet always chooses the last output you received when sending, where there is at least one other output which could be sent instead, then is seems to be a bug.
-
moneromooo
Modulo what I said above, etc.
-
afungible[m]1
Got it. I will test this further if it is indeed the case. Thanks moneromooo