Bitcoin Forum

Bitcoin => Bitcoin Discussion => Topic started by: jgarzik on March 17, 2011, 09:12:52 PM



Title: Dynamic wallet triggers
Post by: jgarzik on March 17, 2011, 09:12:52 PM
It seems some ability to script local bitcoin wallet actions would be useful.  For example, give the user the ability to add "rules" to the local wallet which specify operations such as

  • if local block generated, send to address X when it matures
  • if money received to account A, move it to account B
  • if money received to account A, send it to address Y



Title: Re: Dynamic wallet triggers
Post by: genjix on March 17, 2011, 09:16:46 PM
It seems some ability to script local bitcoin wallet actions would be useful.  For example, give the user the ability to add "rules" to the local wallet which specify operations such as

  • if local block generated, send to address X when it matures
  • if money received to account A, move it to account B
  • if money received to account A, send it to address Y


cron job.

Optionally add the ability for bitcoin to call external scripts on trigger actions with the action name + params.


Title: Re: Dynamic wallet triggers
Post by: jgarzik on March 17, 2011, 09:49:52 PM
It seems some ability to script local bitcoin wallet actions would be useful.  For example, give the user the ability to add "rules" to the local wallet which specify operations such as

  • if local block generated, send to address X when it matures
  • if money received to account A, move it to account B
  • if money received to account A, send it to address Y


cron job.

Part of the point is to prevent ugly, useless polling...  ;p

Quote
Optionally add the ability for bitcoin to call external scripts on trigger actions with the action name + params.

Sure.



Title: Re: Dynamic wallet triggers
Post by: ryepdx on March 18, 2011, 05:44:36 AM
I like the idea. Having some way to natively hook into bitcoin events would be quite helpful, particularly to anyone trying to set up their own merchant script. Depending on how flexible the scripting language proves, it could also potentially allow for crude automated selling without the need for a third party.


Title: Re: Dynamic wallet triggers
Post by: LMGTFY on March 18, 2011, 10:23:43 PM
I like the idea. Having some way to natively hook into bitcoin events would be quite helpful, particularly to anyone trying to set up their own merchant script. Depending on how flexible the scripting language proves, it could also potentially allow for crude automated selling without the need for a third party.

Subversion (http://svnbook.red-bean.com/en/1.5/svn.reposadmin.create.html#svn.reposadmin.create.hooks), a version control system, has a neat approach: any script or executable can be run when certain events occur: Subversion simply looks for a script or executable with a certain name. It allows for a limited number of parameters, so - transferring Subversion's system to Bitcoin - something like "2.37 bitcoins received in account 'From mining pool' with address '175tVkmMKwwEppDRNnBY2SnTzFUmJJhzZ7'" might trigger a script named "bitcoins-received" that checks the account name, and if the account is called 'From mining pool' the script would then send 2.37 BTC to another address, and then email a Hotmail account, play an mp3 file, or do pretty much anything you can think of...

What I like about Subversion's approach is that we're not tied to any one scripting language: having Python, say, installed doesn't become a requirement of using Bitcoin for anything other than "basic stuff".