pooya87
Legendary
Offline
Activity: 3514
Merit: 10713
|
|
March 22, 2022, 04:27:34 AM |
|
Some bank have feature "Scheduled Money Transfer" where customer just need to configure the schedule few times. It's more convenient than sending the money at specific time.
In bitcoin we say "you are your own bank", so to achieve something like this feature it may be better to write a simple script on top of your node/wallet software that creates a new transaction, signs it and broadcasts it at fixed intervals with predefined conditions. This is also easier to cancel (it is local) compared to sending a valid tx with a future locktime that you'd have to double spend.
|
█████████████████████████ ████████▀▀████▀▀█▀▀██████ █████▀████▄▄▄▄██████▀████ ███▀███▄████████▄████▀███ ██▀███████████████████▀██ █████████████████████████ █████████████████████████ █████████████████████████ ██▄███████████████▀▀▄▄███ ███▄███▀████████▀███▄████ █████▄████▀▀▀▀████▄██████ ████████▄▄████▄▄█████████ █████████████████████████ | BitList | | █▀▀▀▀ █ █ █ █ █ █ █ █ █ █ █ █▄▄▄▄ | ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ . REAL-TIME DATA TRACKING CURATED BY THE COMMUNITY . ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ | ▀▀▀▀█ █ █ █ █ █ █ █ █ █ █ █ ▄▄▄▄█ | | List #kycfree Websites |
|
|
|
witcher_sense
Legendary
Offline
Activity: 2408
Merit: 4374
🔐BitcoinMessage.Tools🔑
|
So far we have been talking about how to solve this problem on the protocol or transactional level, but no one did mention the possibility of achieving exactly the same result using less-technical means, which is the capabilities of operating system in which a bitcoin wallet is installed. I was wondering if it was possible to schedule a bitcoin transaction and make it confirmed by the network or, at least, make it sent, at a specific point in time. I found the solution for this problem here: https://bitcoin.stackexchange.com/questions/29574/how-to-schedule-a-bitcoin-transaction but can't confirm it actually works. For Linux and macOS: echo "bitcoind sendtoaddress <bitcoinaddress> <amount>" | at 07:00
or sleep <number of seconds> && bitcoind sendtoaddress <bitcoinaddress> <amount>
For Windows: timeout <number of seconds> && bitcoind sendtoaddress <bitcoinaddress> <amount>
If it works then it is possible to use Windows Task Scheduler or something similar for specifying more complex conditions.
|
|
|
|
nc50lc
Legendary
Offline
Activity: 2478
Merit: 5819
Self-proclaimed Genius
|
|
March 22, 2022, 10:29:55 AM |
|
For Windows: timeout <number of seconds> && bitcoind sendtoaddress <bitcoinaddress> <amount>
It will work as long as the command prompt is still open until the timeout runs out. Also, the command should be using bitcoin-cli since bitcoind doesn't support wallet RPC commands.
|
|
|
|
seoincorporation
Legendary
Offline
Activity: 3220
Merit: 3011
|
|
March 22, 2022, 10:41:48 PM |
|
The right way to avoid a confirmation in the next block is using low fees, this way the miners will give low priority to your transaction. ... You can manually construct a transaction even with negative fees. The question is will nodes or miners accept such a transaction? Do you mean using SIGHASH_SINGLE|SIGHASH_ANYONECANPAY, where the output is higher than the input? Then yes, in this case someone can pay fees for you. I don't think the core will allow us to spend more coins than the inputs, it should print an error. As we know, when we build a transaction we don't set the fees, we only set the amount to send and the rest will go to the fees. That's why I don't think negative fees transactions are possible, but I haven't tried, so, maybe I'm wrong.
|
|
|
|
vjudeu
|
|
March 23, 2022, 08:08:07 AM |
|
I don't think the core will allow us to spend more coins than the inputs, it should print an error. It will be "incomplete", but not "invalid". If included directly into a block, that block will be invalid. But if someone will receive raw transaction, then that person could add more coins as inputs and make it valid, without changing previous signatures. As we know, when we build a transaction we don't set the fees, we only set the amount to send and the rest will go to the fees. That's why I don't think negative fees transactions are possible, but I haven't tried, so, maybe I'm wrong. Yes, "negative fees" is just some kind of shortcut. Fees are always non-negative, the only thing that can be changed is who will pay them. That means, it is possible to create "recipient pay fees" transaction, instead of typical "sender pay fees".
|
|
|
|
n0nce
|
|
March 23, 2022, 11:58:52 AM |
|
I don't think the core will allow us to spend more coins than the inputs, it should print an error. It will be "incomplete", but not "invalid". If included directly into a block, that block will be invalid. But if someone will receive raw transaction, then that person could add more coins as inputs and make it valid, without changing previous signatures. Can you just add more inputs to the transactions and more witnesses spending those extra inputs? I'm not sure right now to be honest. I doubt it though.
|
|
|
|
vjudeu
|
|
March 23, 2022, 12:28:20 PM |
|
Can you just add more inputs to the transactions and more witnesses spending those extra inputs? I'm not sure right now to be honest. I doubt it though. Yes, of course you can. Just use different SIGHASH than SIGHASH_ALL. Many people don't believe such things are possible, so maybe I should create some transaction in testnet to demonstrate that. 0200000000010157c810eb18266e2a09e6f244c38f00731f6c1a29765dc3d1fd5142477101b2660100000000fdffffff01a0860100000000001600145df5785bcc56cd3079a798a9bdbbf45dd3217c000247304402204d6b7bfffbe03b4e17aa08ce42ac12aff30a8f68dd58d19b6b3a9be9535ab328022058de9a2b17369dc326c289728ebf9a27df1c41e43feb81c9c6ca627544bfc0c3832102f37ddcc9aa8bec6ab201519e2d4de3d9ad2e99a566cf0b2232351ea6ac1f984400000000 This is testnet3 transaction that could consume 0.00074000 tBTC and send 0.00100000 tBTC back to me. If you want to see that in action, you can add your own inputs and give me some test coins (and also pay my fees). Also I can change it to some 2-of-2 multisig and create a closing transaction if you want to get my coins immediately after testing such feature.
|
|
|
|
seoincorporation
Legendary
Offline
Activity: 3220
Merit: 3011
|
|
March 23, 2022, 04:38:17 PM |
|
... Yes, of course you can. Just use different SIGHASH than SIGHASH_ALL. Many people don't believe such things are possible, so maybe I should create some transaction in testnet to demonstrate that. 0200000000010157c810eb18266e2a09e6f244c38f00731f6c1a29765dc3d1fd5142477101b2660100000000fdffffff01a0860100000000001600145df5785bcc56cd3079a798a9bdbbf45dd3217c000247304402204d6b7bfffbe03b4e17aa08ce42ac12aff30a8f68dd58d19b6b3a9be9535ab328022058de9a2b17369dc326c289728ebf9a27df1c41e43feb81c9c6ca627544bfc0c3832102f37ddcc9aa8bec6ab201519e2d4de3d9ad2e99a566cf0b2232351ea6ac1f984400000000 This is testnet3 transaction that could consume 0.00074000 tBTC and send 0.00100000 tBTC back to me. If you want to see that in action, you can add your own inputs and give me some test coins (and also pay my fees). Also I can change it to some 2-of-2 multisig and create a closing transaction if you want to get my coins immediately after testing such feature. I just decoded the transaction you posted, this will help to the users to understand it better { "addresses": [ "tb1qfdte9urq8qcej28uyu9dhar6j593rg7t9pncpv", "tb1qth6hsk7v2mxnq7d8nz5mmwl5thfjzlqq5jlvnv" ], "block_height": -1, "block_index": -1, "confirmations": 0, "double_spend": false, "fees": 0, "hash": "0507f906ba3fd0f4f35d990f299d825eb2fae2191ff52c5eec99f77ca6bf4e3d", "inputs": [ { "addresses": [ "tb1qfdte9urq8qcej28uyu9dhar6j593rg7t9pncpv" ], "age": 2191113, "output_index": 1, "output_value": 74000, "prev_hash": "66b20171474251fdd1c35d76291a6c1f73008fc344f2e6092a6e2618eb10c857", "script_type": "pay-to-witness-pubkey-hash", "sequence": 4294967293, "witness": [ "304402204d6b7bfffbe03b4e17aa08ce42ac12aff30a8f68dd58d19b6b3a9be9535ab328022058de9a2b17369dc326c289728ebf9a27df1c41e43feb81c9c6ca627544bfc0c383", "02f37ddcc9aa8bec6ab201519e2d4de3d9ad2e99a566cf0b2232351ea6ac1f9844" ] } ], "opt_in_rbf": true, "outputs": [ { "addresses": [ "tb1qth6hsk7v2mxnq7d8nz5mmwl5thfjzlqq5jlvnv" ], "script": "00145df5785bcc56cd3079a798a9bdbbf45dd3217c00", "script_type": "pay-to-witness-pubkey-hash", "value": 100000 } ], "preference": "low", "received": "2022-03-23T16:31:10.151152928Z", "relayed_by": "3.94.98.131", "size": 191, "total": 100000, "ver": 2, "vin_sz": 1, "vout_sz": 1, "vsize": 110 } And you are right, the inputs are smaller than the outputs. And this is possible while we create the transaction, but when we try to push the transaction we will get an error on the network as you can see in the next image: Error validating transaction: Sum of inputs 74000 lesser than outputs 100000.
|
|
|
|
garlonicon
|
|
March 23, 2022, 04:56:41 PM |
|
but when we try to push the transaction we will get an error on the network as you can see in the next image Of course, because it is a "negative fee" transaction. So, if you want to broadcast it to the network, then you need to add your own coins, then vjudeu will get your coins for free and you will pay his fees
|
|
|
|
n0nce
|
|
March 23, 2022, 06:11:26 PM |
|
Can you just add more inputs to the transactions and more witnesses spending those extra inputs? I'm not sure right now to be honest. I doubt it though. Yes, of course you can. Just use different SIGHASH than SIGHASH_ALL. Many people don't believe such things are possible, so maybe I should create some transaction in testnet to demonstrate that. 0200000000010157c810eb18266e2a09e6f244c38f00731f6c1a29765dc3d1fd5142477101b2660100000000fdffffff01a0860100000000001600145df5785bcc56cd3079a798a9bdbbf45dd3217c000247304402204d6b7bfffbe03b4e17aa08ce42ac12aff30a8f68dd58d19b6b3a9be9535ab328022058de9a2b17369dc326c289728ebf9a27df1c41e43feb81c9c6ca627544bfc0c3832102f37ddcc9aa8bec6ab201519e2d4de3d9ad2e99a566cf0b2232351ea6ac1f984400000000 This is testnet3 transaction that could consume 0.00074000 tBTC and send 0.00100000 tBTC back to me. If you want to see that in action, you can add your own inputs and give me some test coins (and also pay my fees). Also I can change it to some 2-of-2 multisig and create a closing transaction if you want to get my coins immediately after testing such feature. Cool, that's good to know! However, if you try to broadcast it through the gossip protocol, it would be dropped by any receiving node's mempool, except if they have some custom code that doesn't drop it and instead adds another input so it can be further forwarded towards a miner, I suppose.
|
|
|
|
garlonicon
|
|
March 23, 2022, 06:17:32 PM Last edit: March 26, 2022, 11:00:51 AM by garlonicon Merited by ABCbits (1), n0nce (1) |
|
However, if you try to broadcast it through the gossip protocol, it would be dropped by any receiving node's mempool, except if they have some custom code that doesn't drop it and instead adds another input so it can be further forwarded towards a miner, I suppose. But even then, you probably need to recompile your client to reach that. Or you could have some proxy that would capture invalid transactions and store some of them, but probably doing changes in Bitcoin Core and making a custom version that would store more transactions would be easier. Exactly, it is true and you understand it correctly. I think everything was said, it is just a matter of reading some posts again. And maybe sharing a public key with vjudeu if you want to see that in practice (without losing any coins). Edit: I wonder if people can combine transactions. Let's see: 0200000000010257c810eb18266e2a09e6f244c38f00731f6c1a29765dc3d1fd5142477101b2660100000000fdffffff8000da95a1986e5ebfe15fbf5fcc70864e12504fb87134a5f53fcc9ee461467c0000000000fdffffff01a0860100000000001600145df5785bcc56cd3079a798a9bdbbf45dd3217c00000247304402204482191bb6555308d065a8c7b9c24e617ee2e6202037c61a5a84f9b799e969ee0220456acaa25d8e794d7eca73be19980fa571e4a432b329b2c8183dbb9589b2d965012102fad16ad186269aa4caf89f19f690801b6f3fec89d04e1c4a40253f60e22eb87440d10c00 For now, it is locked, just to stick to the topic and make it really slow. But you can reply with your multisig, then I could make it faster, to form a complete example.
|
|
|
|
coinlatte
Newbie
Offline
Activity: 21
Merit: 16
|
|
May 02, 2022, 07:04:04 PM |
|
For now, it is locked, just to stick to the topic and make it really slow. But you can reply with your multisig, then I could make it faster, to form a complete example. I think vjudeu waited long enough, here you are: 495d2007ae8b741c70c3d278c02ce03702223b9675e954ecabbb634c6cd5bf40. As everyone can see, vjudeu's signature is exactly the same, that means I could just copy-pasted it, without asking for re-signing.
|
|
|
|
|