Automatically refunding transactions sent from unregistered accounts?

Started by monsterer, January 15, 2015, 08:40:49 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

xeroc

Quote from: monsterer on January 15, 2015, 10:34:20 AM
Quote from: xeroc on January 15, 2015, 10:10:16 AM
every withdraw tx uses a balance_id (address) that holds funds to withdraw from ..
you can just send the funds there and the client should catch up that transaction ..
there's no need to 'identify' the unregistered account .. just refund to the address (balance_id) you received the money from ..

Are there any docs on what all these fields mean? I had assumed balance_id was like a UTXO and that 'from_account' was the sender.

Take a look at part of this deposit:

{
          "type": "withdraw_op_type",
          "data": {
            "balance_id": "BTS6UCvWSmZAsSmhp5E4JRrTLqirBFu7Lfng",
            "amount": 10000,
            "claim_input_data": ""
          }
        },{
          "type": "withdraw_op_type",
          "data": {
            "balance_id": "BTSASw7dDN1u3VaSNw5SNYk1WNN9uKBWZoDU",
            "amount": 10000,
            "claim_input_data": ""
          }
        }


As you can see there are two balance_id's here, so which one do I pick? AFAIK, I can't send to more than one address in one transaction?

balance_id is indeed like a UTXO .. but in bitshares you don't have change-addresses .. so what you do is basically just substract the amount from the balance and leave the rest in the balance_id/address.

in your case the "output" is bigger as your balance_id so that your tx has to combine several "inputs"/utxo

the "output" of the transaction is called "deposit_op_type" and contains a "withdraw_condition" .. which is usually "withdraw_signature_type" .. so you can withdraw with a valid signature ..

as for the "claim_input_data" .. my guess is that this field is required for some specialized withdraw conditions such as the withdraw_by_password .. and contains a parameter of some kind

monsterer

Quote from: xeroc on January 15, 2015, 10:10:16 AM
every withdraw tx uses a balance_id (address) that holds funds to withdraw from ..
you can just send the funds there and the client should catch up that transaction ..
there's no need to 'identify' the unregistered account .. just refund to the address (balance_id) you received the money from ..

Are there any docs on what all these fields mean? I had assumed balance_id was like a UTXO and that 'from_account' was the sender.

Take a look at part of this deposit:

{
          "type": "withdraw_op_type",
          "data": {
            "balance_id": "BTS6UCvWSmZAsSmhp5E4JRrTLqirBFu7Lfng",
            "amount": 10000,
            "claim_input_data": ""
          }
        },{
          "type": "withdraw_op_type",
          "data": {
            "balance_id": "BTSASw7dDN1u3VaSNw5SNYk1WNN9uKBWZoDU",
            "amount": 10000,
            "claim_input_data": ""
          }
        }


As you can see there are two balance_id's here, so which one do I pick? AFAIK, I can't send to more than one address in one transaction?
My opinions do not represent those of metaexchange unless explicitly stated.
[url="https://metaexchange.info"]https://metaexchange.info[/url] | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

xeroc

every withdraw tx uses a balance_id (address) that holds funds to withdraw from ..
you can just send the funds there and the client should catch up that transaction ..
there's no need to 'identify' the unregistered account .. just refund to the address (balance_id) you received the money from ..

monsterer

I can refund a transaction from a registered account by looking at the from_account field, which is their account name. An unregistered account has a stealth public key in place of the account name - so, how do I know where to send the refund?
My opinions do not represent those of metaexchange unless explicitly stated.
[url="https://metaexchange.info"]https://metaexchange.info[/url] | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads