Bitcoin Forum
November 20, 2017, 12:54:47 AM *
News: Latest stable version of Bitcoin Core: 0.15.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Question about script  (Read 696 times)
ThePurplePlanet
Full Member
***
Offline Offline

Activity: 144


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?
1511139287
Hero Member
*
Offline Offline

Posts: 1511139287

View Profile Personal Message (Offline)

Ignore
1511139287
Reply with quote  #2

1511139287
Report to moderator
1511139287
Hero Member
*
Offline Offline

Posts: 1511139287

View Profile Personal Message (Offline)

Ignore
1511139287
Reply with quote  #2

1511139287
Report to moderator
1511139287
Hero Member
*
Offline Offline

Posts: 1511139287

View Profile Personal Message (Offline)

Ignore
1511139287
Reply with quote  #2

1511139287
Report to moderator
Join ICO Now A blockchain platform for effective freelancing
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1511139287
Hero Member
*
Offline Offline

Posts: 1511139287

View Profile Personal Message (Offline)

Ignore
1511139287
Reply with quote  #2

1511139287
Report to moderator
1511139287
Hero Member
*
Offline Offline

Posts: 1511139287

View Profile Personal Message (Offline)

Ignore
1511139287
Reply with quote  #2

1511139287
Report to moderator
telepatheic
Jr. Member
*
Offline Offline

Activity: 56

Get off the web. Go do something in meatspace!


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: 1246


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
Full Member
***
Offline Offline

Activity: 144


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: 1246


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
Full Member
***
Offline Offline

Activity: 144


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: 1246


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

Get off the web. Go do something in meatspace!


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

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

Activity: 144


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


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: 2016



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 unverifiable things (while actually eating an enchilada-style burrito) for bitcoins: 1K6d1EviQKX3SVKjPYmJGyWBb1avbmCFM4
jl2012
Legendary
*
Offline Offline

Activity: 1722


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
PGP: D3CC 1772 8600 5BB8 FF67 3294 C524 2A1A B393 6517
gmaxwell
Moderator
Legendary
*
qt
Offline Offline

Activity: 2338



View Profile
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.

Bitcoin will not be compromised
Schumacher
Jr. Member
*
Offline Offline

Activity: 58


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


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:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!