Author

Topic: Question about script (Read 786 times)

sr. member
Activity: 280
Merit: 257
bluemeanie
May 04, 2014, 12:54:06 PM
#15
I was wondering if  a bitcoin script can be written to execute based on an address total balance. For example, if total balance exceeds a number of bitcoins forward it to another address. Any thoughts?

no.  that's the sort of thing Ethereum is attempting to do.

-bm
newbie
Activity: 74
Merit: 0
May 04, 2014, 12:48:31 PM
#14
Simple answer: no.

More in depth answer: Bitcoin scripts only have a single output: true or false. If they output false then the transaction is not valid. Scripts can't modify anything in the transaction nor do they have access to any data except data explicitly included in the script section.

I didn't get the depth answer but the short one perfectly satisfied me
staff
Activity: 4242
Merit: 8672
May 04, 2014, 02:01:10 AM
#13
There is nothing called "balance" in the bitcoin protocol.
Or even resembling one under a different name. The Bitcoin protocol tracks txouts— the closest analogy would be thinking of it tracking individual coins with their requirements for spending stamped on them, which come in arbitrary denomination. They're spent atomically— in a process that melts down the original coins after checking their rules which yields new coins of new denominations and new rules stamped on them.
legendary
Activity: 1792
Merit: 1111
May 04, 2014, 12:30:16 AM
#12
I was wondering if  a bitcoin script can be written to execute based on an address total balance. For example, if total balance exceeds a number of bitcoins forward it to another address. Any thoughts?

There is nothing called "balance" in the bitcoin protocol.
legendary
Activity: 4522
Merit: 3183
Vile Vixen and Miss Bitcointalk 2021-2023
May 04, 2014, 12:12:33 AM
#11
The functionality looks very limited then. Is it possible to expand the functionality? Are there are plans? Any research into this?
The reason the functionality is limited is to ensure that in the event of a chain reorg, transactions that were valid on the old chain are still valid on the new chain (barring double-spend attacks). This is only possible if transactions do not depend on anything external to the transaction itself that might change during a reorg.

Since a reorg can change the ordering of transactions, the balance of an address may be temporarily changed, resulting in your script sending to a different address than it did originally, which would be a Bad Thing.
full member
Activity: 122
Merit: 100
May 02, 2014, 10:56:06 PM
#10
Well it is not really possible using the bitcoins, but it is possible on the server, receiving virtual payments and then divide the amount based on balances. Like create a web wallet, and then receive payments, and after certain amount, the wallets get changed automated. It is infact possible.
full member
Activity: 144
Merit: 100
May 02, 2014, 07:24:13 PM
#9
Ethereum is expanding the scripting capabilities of a crypto-currency.

Well I am not interested in ethereum unless it gets some significant network. Ethereum has better chance to be useful for me if someone creates a side chain with it and bitcoin users move in and out to it..
jr. member
Activity: 56
Merit: 1
May 02, 2014, 05:54:59 PM
#8
Ethereum is expanding the scripting capabilities of a crypto-currency.
legendary
Activity: 1302
Merit: 1008
Core dev leaves me neg feedback #abuse #political
May 02, 2014, 05:51:03 PM
#7
I personally don't know about any plans to expand bitcoins' internal scripting language.

What are you trying to do exactly?  Maybe someone will have some good advice.
full member
Activity: 144
Merit: 100
May 02, 2014, 05:45:44 PM
#6
You could write an external script to do it though... Look up the balance of an address, create a signed transaction and broadcast it.

Well if you need to do it in a decentralized way this is not possible.
legendary
Activity: 1302
Merit: 1008
Core dev leaves me neg feedback #abuse #political
May 02, 2014, 05:43:30 PM
#5
Why mess with bitcoin core when there's already external libraries being created.

http://bitcoinjs.org
full member
Activity: 144
Merit: 100
May 02, 2014, 05:38:48 PM
#4
The functionality looks very limited then. Is it possible to expand the functionality? Are there are plans? Any research into this?
legendary
Activity: 1302
Merit: 1008
Core dev leaves me neg feedback #abuse #political
May 02, 2014, 05:33:19 PM
#3
You could write an external script to do it though... Look up the balance of an address, create a signed transaction and broadcast it.
jr. member
Activity: 56
Merit: 1
May 02, 2014, 05:29:43 PM
#2
Simple answer: no.

More in depth answer: Bitcoin scripts only have a single output: true or false. If they output false then the transaction is not valid. Scripts can't modify anything in the transaction nor do they have access to any data except data explicitly included in the script section.
full member
Activity: 144
Merit: 100
May 02, 2014, 05:18:15 PM
#1
I was wondering if  a bitcoin script can be written to execute based on an address total balance. For example, if total balance exceeds a number of bitcoins forward it to another address. Any thoughts?
Jump to: