Pages:
Author

Topic: Intentionally make a transaction slower (Read 504 times)

newbie
Activity: 21
Merit: 16
May 02, 2022, 02:04:04 PM
#32
Quote
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.
copper member
Activity: 821
Merit: 1992
March 23, 2022, 01:17:32 PM
#31
Quote
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.
Quote
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:
Code:
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.
hero member
Activity: 882
Merit: 5834
not your keys, not your coins!
March 23, 2022, 01:11:26 PM
#30
Quote
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.
Code:
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.
copper member
Activity: 821
Merit: 1992
March 23, 2022, 11:56:41 AM
#29
Quote
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 Smiley
legendary
Activity: 3346
Merit: 3125
March 23, 2022, 11:38:17 AM
#28
...
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.
Code:
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 Wink

Code:
{
    "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.

copper member
Activity: 901
Merit: 2244
March 23, 2022, 07:28:20 AM
#27
Quote
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.
Code:
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.
hero member
Activity: 882
Merit: 5834
not your keys, not your coins!
March 23, 2022, 06:58:52 AM
#26
Quote
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.
copper member
Activity: 901
Merit: 2244
March 23, 2022, 03:08:07 AM
#25
Quote
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.

Quote
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".
legendary
Activity: 3346
Merit: 3125
March 22, 2022, 05:41:48 PM
#24
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.

...
Quote
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.
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
March 22, 2022, 05:29:55 AM
#23
For Windows:

Code:
timeout  && bitcoind sendtoaddress  
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.
legendary
Activity: 2450
Merit: 4415
🔐BitcoinMessage.Tools🔑
March 22, 2022, 02:04:51 AM
#22
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:

Code:
echo "bitcoind sendtoaddress  " | at 07:00

or

Code:
sleep  && bitcoind sendtoaddress  

For Windows:

Code:
timeout  && bitcoind sendtoaddress  

If it works then it is possible to use Windows Task Scheduler or something similar for specifying more complex conditions.
legendary
Activity: 3472
Merit: 10611
March 21, 2022, 11:27:34 PM
#21
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.
copper member
Activity: 821
Merit: 1992
March 21, 2022, 10:11:45 AM
#20
Quote
While OP never state his intention, i can see why he ask such question. 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.
Adding locktime and sending raw transaction to the recipient would do the trick. Also, it could be cancelled by double-spending the same coins without timelock, so that recipient's transaction will be invalidated.

Quote
Is it even possible to modify signed transaction?
Yes, just use something else than SIGHASH_ALL. You don't have to sign everything, that's only the default option, but could be easily changed if needed.
hero member
Activity: 882
Merit: 5834
not your keys, not your coins!
March 21, 2022, 07:35:50 AM
#19
Is it even possible to modify signed transaction?
Yes, but you need have the signing key. I mean you could change the witness to modify the TXID, due the fact that in ECDSA you can easily calculate a second valid signature off of the original one, sure.
But for adding more inputs, you're changing the body, so you do need to calculate a whole new signature of it, which requires the signing key and you basically double-spend the input. The transaction would need to be marked RBF though. So yes, very hypothetical scenario. It could happen e.g. that someone submits a transaction with negative fee and themselves, add a second input after noticing that it's faulty.

To be clear, this isn't really modifying the signed transaction, it would be replacing it instead. And can't happen after it's mined as well, of course.
legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
March 21, 2022, 07:25:22 AM
#18
Your question doesn't make any sense,if you want your transaction to arrive at X date just send it at that X date why you're going through all this hassle just to make it slower.

While OP never state his intention, i can see why he ask such question. 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.

To subsidize such transactions, the miner would need to modify the transaction and add more inputs, because block checks should (correct me if I'm wrong) check all transactions on validity one-by-one.

Is it even possible to modify signed transaction?
legendary
Activity: 1512
Merit: 4795
Leading Crypto Sports Betting & Casino Platform
March 21, 2022, 03:06:18 AM
#17
The means of creating the transaction is irrelevant. The point is that you could create a tx with a negative fee (by modifying software the creates transactions), however that no miner is ever going to intentionally accept this transaction into their block. Doing so would not be rational.
Exactly. Creating the transaction will be highly irrelevant, miners are the ones that include transactions into block and they only accept transaction with incentives paid as fee, if a transaction is having a negative fee, then it means the person that make the transaction will be the one that will be paid fee while the payment can only be from miners. When miners are only encouraged by the fee, how would they include a transaction into a block in which they would be the one to lose (if provided there is a means miners can make the payment), definitely no miner will include such transaction in a block.
hero member
Activity: 882
Merit: 5834
not your keys, not your coins!
March 20, 2022, 08:30:18 PM
#16

The means of creating the transaction is irrelevant. The point is that you could create a tx with a negative fee (by modifying software the creates transactions), however that no miner is ever going to intentionally accept this transaction into their block. Doing so would not be rational.
the miner would have to subsidize the transaction using their block reward or some other mechanism.
I don't think it would be possible to mine such a transaction; the block would get rejected.
Let's remember that mining fee is simply the difference between your inputs and outputs.
The difference between the amount being spent and the amount being received is the transaction fee (which must be zero or more)
If it is negative, it means your input sum is smaller than the output sum, basically creating coins out of thin air. A block mined with such a transaction inside it, would be rejected by any node. To subsidize such transactions, the miner would need to modify the transaction and add more inputs, because block checks should (correct me if I'm wrong) check all transactions on validity one-by-one. So even if on a block-level it were to canceled out by some extra 'subsidy transaction' from the miner, not all checks would pass.
jr. member
Activity: 94
Merit: 1
March 20, 2022, 08:17:13 AM
#15
Usually people want their transactions to confirm as fast as possible, but I was wondering, are there ways of making a transaction slower to confirm? Like taking 10 blocks or more to confirm?

I can only think of one obvious way, paying a very low fee. Obviously this would only work when the network is congested.

Can we think of any other ways?

Also, it used to be possible to make zero-fee transactions. Is this still possible in 2022?
 
Your question doesn't make any sense,if you want your transaction to arrive at X date just send it at that X date why you're going through all this hassle just to make it slower.
copper member
Activity: 821
Merit: 1992
March 20, 2022, 08:05:24 AM
#14
Quote
If a transaction has more outputs than inputs (in terms of total value), the difference would come out of the block reward.
The Bitcoin Core client in regtest says it is invalid:
Code:
generateblock "bcrt1qlaf0ku3nhu26mffln8kn2rhgjfaduda9azzlfa" "[\"02000000018fa4883cae979495c8a9c1e7e52e10127950cd3a56a6c5c6ad327db85690e9f20000000000fdffffff0100e40b540200000016001484756196d612a86b3be4ea34fff3158fe5576c7c00000000\"]"
TestBlockValidity failed: bad-txns-in-belowout, value in (50.00) < value out (100.00) (code -25)
You can create some block in regtest and paste it here if you think it is possible. As far as I checked, each transaction has to be correct, so it is not possible to have some transaction creating coins out of thin air and some miner paying for that by taking less coins in the coinbase transaction.
copper member
Activity: 1652
Merit: 1901
Amazon Prime Member #7
March 20, 2022, 07:28:34 AM
#13

The means of creating the transaction is irrelevant. The point is that you could create a tx with a negative fee (by modifying software the creates transactions), however that no miner is ever going to intentionally accept this transaction into their block. Doing so would not be rational.
the miner would have to subsidize the transaction using their block reward or some other mechanism.
Right. The block reward is the sum of block subsidy, and all inputs, minus the sum of all outputs. If a transaction has more outputs than inputs (in terms of total value), the difference would come out of the block reward.

No miner is going to do this.
Pages:
Jump to: