Bitcoin Forum
April 25, 2024, 02:58:01 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Question about script  (Read 758 times)
ThePurplePlanet (OP)
Full Member
***
Offline Offline

Activity: 144
Merit: 100


View Profile
May 02, 2014, 10: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?
1714057081
Hero Member
*
Offline Offline

Posts: 1714057081

View Profile Personal Message (Offline)

Ignore
1714057081
Reply with quote  #2

1714057081
Report to moderator
1714057081
Hero Member
*
Offline Offline

Posts: 1714057081

View Profile Personal Message (Offline)

Ignore
1714057081
Reply with quote  #2

1714057081
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714057081
Hero Member
*
Offline Offline

Posts: 1714057081

View Profile Personal Message (Offline)

Ignore
1714057081
Reply with quote  #2

1714057081
Report to moderator
1714057081
Hero Member
*
Offline Offline

Posts: 1714057081

View Profile Personal Message (Offline)

Ignore
1714057081
Reply with quote  #2

1714057081
Report to moderator
telepatheic
Jr. Member
*
Offline Offline

Activity: 56
Merit: 1


View Profile
May 02, 2014, 10: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.
jonald_fyookball
Legendary
*
Offline Offline

Activity: 1302
Merit: 1004


Core dev leaves me neg feedback #abuse #political


View Profile
May 02, 2014, 10: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.

ThePurplePlanet (OP)
Full Member
***
Offline Offline

Activity: 144
Merit: 100


View Profile
May 02, 2014, 10: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?
jonald_fyookball
Legendary
*
Offline Offline

Activity: 1302
Merit: 1004


Core dev leaves me neg feedback #abuse #political


View Profile
May 02, 2014, 10:43:30 PM
 #5

Why mess with bitcoin core when there's already external libraries being created.

http://bitcoinjs.org

ThePurplePlanet (OP)
Full Member
***
Offline Offline

Activity: 144
Merit: 100


View Profile
May 02, 2014, 10: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.
jonald_fyookball
Legendary
*
Offline Offline

Activity: 1302
Merit: 1004


Core dev leaves me neg feedback #abuse #political


View Profile
May 02, 2014, 10: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.

telepatheic
Jr. Member
*
Offline Offline

Activity: 56
Merit: 1


View Profile
May 02, 2014, 10:54:59 PM
 #8

Ethereum is expanding the scripting capabilities of a crypto-currency.
ThePurplePlanet (OP)
Full Member
***
Offline Offline

Activity: 144
Merit: 100


View Profile
May 03, 2014, 12:24:13 AM
 #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..
monsterbitty
Full Member
***
Offline Offline

Activity: 122
Merit: 100


View Profile
May 03, 2014, 03:56:06 AM
 #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.
Foxpup
Legendary
*
Offline Offline

Activity: 4340
Merit: 3042


Vile Vixen and Miss Bitcointalk 2021-2023


View Profile
May 04, 2014, 05: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.

Will pretend to do unspeakable things (while actually eating a taco) for bitcoins: 1K6d1EviQKX3SVKjPYmJGyWBb1avbmCFM4
I am not on the scammers' paradise known as Telegram! Do not believe anyone claiming to be me off-forum without a signed message from the above address! Accept no excuses and make no exceptions!
jl2012
Legendary
*
Offline Offline

Activity: 1792
Merit: 1092


View Profile
May 04, 2014, 05: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.

Donation address: 374iXxS4BuqFHsEwwxUuH3nvJ69Y7Hqur3 (Bitcoin ONLY)
LRDGENPLYrcTRssGoZrsCT1hngaH3BVkM4 (LTC)
PGP: D3CC 1772 8600 5BB8 FF67 3294 C524 2A1A B393 6517
gmaxwell
Moderator
Legendary
*
expert
Offline Offline

Activity: 4158
Merit: 8382



View Profile WWW
May 04, 2014, 07: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.
Schumacher
Newbie
*
Offline Offline

Activity: 74
Merit: 0


View Profile
May 04, 2014, 05: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
bluemeanie1
Sr. Member
****
Offline Offline

Activity: 280
Merit: 257


bluemeanie


View Profile WWW
May 04, 2014, 05: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

Just who IS bluemeanie?    On NXTautoDAC and a Million Stolen NXT

feel like your voice isn't being heard? PM me.   |   stole 1M NXT?
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!