1
I am new to bitcoin so please bear my question. To understand the IN's and OUT's of this crypto world, i am creating a dummy bank to have a better understanding of the system.
So I have a bitcoin core running in my local system. Now for each user in the system I create an account for them using the getaccountaddress.
So let us consider I have one account named A having a deposit of 10 BTC. Now, suppose the user A wish to withdraw 1BTC from his account so, I first find all unspent transactions filter it by address associated by account A and send this 1BTC to user A. Now as I understand that the bitcoin cannot be partially spent so the remaining change will go to a change address so I provided account A's address from which the transaction was created.
Now my problem is that if the user again wishes to withdraw, I cannot find any unspent transaction since the change is not yet received immediately and will only be available when the transaction is confirmed. So what is better way to handle this? What is a typical standard to handle such situation? How does wallet like Electrum works as I can see that I can send multiple transactions one after another.
Why send them one after another rather than aggregating them into a single transaction? – David Schwartz – 2019-05-31T16:49:02.077
How about an order processing system where I wish to process an order as soon as I receive? – Paras – 2019-05-31T17:39:25.943
Then I'd just treat all the bitcoins that I had as one common pool. If the payment was on behalf of a particular account, I'd debit that account for the payment but I wouldn't try to use segregated bitcoins for each account, it makes things much less efficient. When you have $10,000 at a bank, there's no specific bills they have that are your $10,000 -- that's what creates the problem you're having. – David Schwartz – 2019-05-31T17:42:40.150
I got your point. ;-) – Paras – 2019-05-31T17:46:24.103
can you help me with this? https://bitcoin.stackexchange.com/questions/88085/bitcoin-core-what-default-values-should-i-pass-for-some-positional-rpc-params-in
– Paras – 2019-05-31T17:47:16.180