How do I write a Smart Contract?

My understand is that Smart Contracts are working as of a few weeks ago, I’ve got one in mind that I’d like to write… how can I get started doing this?  Where do I write my code?  How do I test it?

Thank you!
  1. See how it’s done for Ethereum. It works the same on Counterparty.
  2. Currently you need to run counterpartyd develop branch edition on testnet in order for compiled Ethereum smart contracts to work (until a new release that supports mainnet comes out).

can this be used?


- Read this for examples:
- devtest-testnet: 
I think that’s the current code running mainnet/testnet and I believe it was upgraded to the latest version (9.49.x) but I don’t think you can publish Smart Contracts (maybe you can, I haven’t tried) that way. The URL above shows it in the CLI, but I don’t know if API is ready (check the docs). If it’s not, then you’d need a local counterpartyd server. Instructions can be found on the main Web site (read “set up bitcoind” and “build from source”). You can use Insight (instructions are on the same page) or Bitcoin Core with jmcorgan addrindex patch.
A recent discussion related to common problems setting it up is here:

Has anyone managed to run any Smart Contracts?  I’m running my own counterpartyd 9.49, develop/testnet.  Counterpartyd runs ok and I have also managed to execute but I can’t get to execute.  I believe I may need pyethereum.  Should this be included in the develop source or should it be obtained from Ethereum’s git hub?



I haven’t tried that stuff yet, but I think you should get it from Ethereum’s Github because if I recall correctly the idea is not to diverge from Ethereum’s implementation and therefore we should use their repo to get that.