Bitcoin Forum
November 16, 2024, 01:17:26 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoin money back. Very useful function.  (Read 366 times)
CryptoPravda (OP)
Full Member
***
Offline Offline

Activity: 422
Merit: 227



View Profile
June 10, 2018, 04:24:21 AM
Last edit: June 16, 2018, 05:45:59 AM by CryptoPravda
 #1

It is very weird that I did not find such a necessary thing as money back. (script for money back).  What I mean.

For example I'm doing crowdfunding.

I publish my bitcoin address
1ApEkg4iGheZ6rgpA8ZP4jmPfCqzDcTrM7

I put the condition, if I do not collect enough of money or conditions are not met, I return all the money to the senders.

I'm looking for a script who would return the money back. But I did not find it and this is very strange.
This is a very useful function. If you received 1000 payments, it is very difficult to return everything manually.
This is not a decentralized solution. But even this I did not find.


Or let's do crowdfunding on writing such a script.  Or tell me please where to find this.

This will turn the world around crowdfunding.

Thank you and sorry for my english.



achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3542
Merit: 6886


Just writing some code


View Profile WWW
June 10, 2018, 07:31:54 AM
Merited by HeRetiK (1)
 #2

This is impossible to do in Bitcoin.

Doing such contracts requires using the Bitcoin scripting language. However the scripting language does not have access to output amounts, nor does it have access to other UTXOs which it would in order to have the correct balance for an address.

nc50lc
Legendary
*
Offline Offline

Activity: 2604
Merit: 6416


Self-proclaimed Genius


View Profile
June 10, 2018, 09:02:31 AM
 #3

Even if it is possible on protocol level, the majority will surely be against this kind of feature due to some dangerous exploits.
But it's not possible, just a "what-if" example.

From my understanding, what OP meant was a script to select or flag all the output's addresses and the corresponding amounts to be able to use them as "contacts" and locally saved in case of a "return-transaction" (just a regular transaction) is needed.
This is possible to implement on 3rd-party wallets or the Bitcoin wallet GUI if you can back it up.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
pebwindkraft
Sr. Member
****
Offline Offline

Activity: 257
Merit: 343


View Profile
June 10, 2018, 09:51:58 AM
 #4

Bitcoin scripting don't support feature you mentioned since it's not turing complete.
...

Can you explain, what this means? Why is Turing completeness required to access data of previous transaction?
As achow pointed out, it is a limitation of the scripting language to access the internal data structures. And the Turing completeness is explicitly removed from bitcoin scripting, to also avoid security issues.
bones261
Legendary
*
Offline Offline

Activity: 1806
Merit: 1828



View Profile
June 15, 2018, 07:27:48 PM
 #5

Is it possible to do this via the Lightning network? You can have people open a channel with your crowdsourcing. Then if you want to do a mass refund, you just return the money to them in the channels they opened with you. You would probably need some kind of script to do this if you don't want to do it manually. I would think this would end up costing no fee to you, since it would be 0 hop transactions. (The funders would incur the fees of first opening the channel and then closing the channel.) I have not personally fiddled with the Lightning Network, yet; so I apologize if this suggestion is way out in left field.
reingard
Newbie
*
Offline Offline

Activity: 45
Merit: 0


View Profile
June 15, 2018, 07:31:21 PM
 #6

You can't do this in a descentralized way. You would need a 3rd party or an script (not "inside the bitcoin protocol") runned by yourself.

For example: cronjob a PHP file that checks the address balance and the date. If when date X arrives the balance is lower than Y, you get every sender address and sends the amount back to them. One of the problems is that you would need to pay the fees for the transactions back to the sender.

btj
Member
**
Offline Offline

Activity: 115
Merit: 16


View Profile
June 15, 2018, 08:07:33 PM
 #7

This is possible if there one input in the transaction ...

If you have 1000 transactions for example, you scan for the transaction that contain only one INPUT, and you can send them back her/his money.

Like this you will solve half of problem, and the others transactions can be made manually.
CryptoPravda (OP)
Full Member
***
Offline Offline

Activity: 422
Merit: 227



View Profile
June 16, 2018, 05:41:14 AM
Last edit: June 16, 2018, 05:53:52 AM by CryptoPravda
 #8

You would need a 3rd party or an script (not "inside the bitcoin protocol") runned by yourself.

yes, that's what I mean.
This is not a decentralized solution. But even this I did not find.

And I think it can be a built-in function in the wallet. When a person decides to return all the funds, minus the fees.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!