Bitcoin Forum
September 26, 2018, 04:07:29 PM *
News: ♦♦ New info! Bitcoin Core users absolutely must upgrade to previously-announced 0.16.3 [Torrent]. All Bitcoin users should temporarily trust confirmations slightly less. More info.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: How to get hands-on with bitcoin script development  (Read 686 times)
ggbtctalk000
Full Member
***
Offline Offline

Activity: 297
Merit: 100


View Profile
September 07, 2017, 04:33:11 PM
 #1

I covered and had basic fundamental understanding of how the scripting (lock or formerly ScriptPubKey and unlock or formerl ScriptSig). The "mastering bitcoin" had fairly good coverage on how scripting works and what purpose it does. However there are faily large number of script op codes available in the appendix, so I am wondering what are good way to get hands-on and write a script and deploy it on live platform?
My wild guess, is most bitcoin wallets will only work with a Pay-to-public-key hash, i imagine one has to develop the proprietary wallet that can send and received bitcoin based on signing of custom scripts. I am going to take another shot at it by saying existing wallets that can send/receive bitcoin using P2SH (pay-to-script-hash) will work. But I believe one still has to write the script and some integrate with the wallet. 
Thanks!
1537978049
Hero Member
*
Offline Offline

Posts: 1537978049

View Profile Personal Message (Offline)

Ignore
1537978049
Reply with quote  #2

1537978049
Report to moderator
1537978049
Hero Member
*
Offline Offline

Posts: 1537978049

View Profile Personal Message (Offline)

Ignore
1537978049
Reply with quote  #2

1537978049
Report to moderator
1537978049
Hero Member
*
Offline Offline

Posts: 1537978049

View Profile Personal Message (Offline)

Ignore
1537978049
Reply with quote  #2

1537978049
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
BitcoinsGreat
Sr. Member
****
Offline Offline

Activity: 388
Merit: 250


View Profile
September 11, 2017, 05:20:38 PM
 #2

I covered and had basic fundamental understanding of how the scripting (lock or formerly ScriptPubKey and unlock or formerl ScriptSig). The "mastering bitcoin" had fairly good coverage on how scripting works and what purpose it does. However there are faily large number of script op codes available in the appendix, so I am wondering what are good way to get hands-on and write a script and deploy it on live platform?
My wild guess, is most bitcoin wallets will only work with a Pay-to-public-key hash, i imagine one has to develop the proprietary wallet that can send and received bitcoin based on signing of custom scripts. I am going to take another shot at it by saying existing wallets that can send/receive bitcoin using P2SH (pay-to-script-hash) will work. But I believe one still has to write the script and some integrate with the wallet. 
Thanks!

Are you trying to get info on writing these in yourself or looking for pre-existing examples? You can try looking at what is happening in the background of something like NXT or ETH.
mrayazgul
Hero Member
*****
Offline Offline

Activity: 546
Merit: 500


View Profile
September 11, 2017, 05:57:32 PM
 #3

Not many people have touched what you are talking about because there is really no market for it right now, but you can play away. I would say to grab a copy of core and use the testnet and a small private network and see what you can do that will get the public interest and show them the possibilities and that might make more action in the coding world, you never know.

    ▄█▄
   ██▀  ▄█▄
  ██▀  ▄█▀  ▄▀
 ██▀  ▄█▀  ▄▀
▐█▌  ▄█▀  ▄▀
██   ██   
██   ██   
██   ██   
▐█▌  ▀█▄  ▀▄
 ██▄  ▀█▄  ▀▄
  ██▄  ▀█▄  ▀▄
   ██▄  ▀█▀
    ▀█▀
████
▀▀▀▀
▄▀▀▄▄▄▄▄▄▄▄█████████████▐████
▀▀     ▄▄▄▄▄▀██████████▐████
▄▀▀▄▄▄▄▄█████▀ ▀▄▄▄     ▐████
▀▀     ▄▀███▄▄▄▄       ▐████
▄▄   ▀█▄▄▄▄▄▄▄▄▄▄▄▄▄▄▐████
▀▄▄▀▀▀▀▀██████████████▐████
▄▄   ▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▐████

▀▄▄▀▀▀  ██████           ▐████
██████▄▀▀▀▀▀▀▀▀▀ ▐████

▄▄  ████▀▄██████████▐████
▀▄▄▀▀▀▀ ▄████████████▐████
BIDIUM       ▄█▄
   ▄█▄
  ▀██

▀▄  ▀█▄  ▀██
 ▀▄  ▀█▄  ▀██
  ▀▄  ▀█▄  ▐█▌
   █   ██   ██
   █   ██   ██
   █   ██   ██
  ▄▀  ▄█▀  ▐█▌
 ▄▀  ▄█▀  ▄██
▄▀
  ▄█▀  ▄██
   ▀█▀
  ▄██
       ▀█▀






























pebwindkraft
Full Member
***
Offline Offline

Activity: 247
Merit: 207


View Profile
September 12, 2017, 05:05:56 PM
 #4

yup, and Andreas' book is great!
There are lots of OpCodes not used, or their combinations creates transactions, which are not forwarded.
I think this is a protection of the network, to avoid loops in scripts and similiar. But the experts need to confirm.
When trying to play with scripts, there is lot of history here, maybe a bit longer ago, but search the forum (maybe the keywords like "OpCode" and "bitcoin contracts").
And when you have an idea, try it on testnet first, then go to live net. I had a lot of help here: http://bitcoin-script-debugger.visvirial.com/

p.s.:
found the reference here in the forum: https://bitcointalk.org/index.php?topic=1840303.0
Kogs
Member
**
Offline Offline

Activity: 86
Merit: 12


View Profile
September 13, 2017, 07:20:55 AM
 #5

Somewhere I heard that at the moment some nodes only allow some predefined scripts.
But I don't know if this is true or not.

The idea behind this was, that you don't burn your coins with some "experimental" scripts where you are not able to spend them anymore.

There are several problems with homemade scripts
  • Possibility, that the coins will get burned if script has an error
  • Possiblility of unintended behaviour. The script could do what you expect, but it could possible also do something you did not expect when it is used with a different set of parameters for example. Maybe someone who use the script differently could steal coins from this script if you don't think of all possiblities (As happend with the Ethereum DAO hack).

To minimize the risk of having such troubles, you should test your scripts always in testnet and also show the script to some experienced people who may find some vulnerabilities before releasing it to the main net.
ggbtctalk000
Full Member
***
Offline Offline

Activity: 297
Merit: 100


View Profile
September 15, 2017, 09:58:48 PM
 #6

ok, it is purely for edu purposes to get hands-on with scripts and op-codes. I may spend few satoshis but not planning to do any trading or gain here.
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!