Quick start guide
Build from sources
Intsall Haskell Tool Stack. You’ll need Stack 2.15, cabal 3.10, and GHC 9.6.
Download Spedn sources.
$ git clone https://bitbucket.org/o-studio/spedn.git
Build and install Spedn.
$ cd spedn/spedn $ stack install
Installation from npm
Alternatively, you can install a JavaScript version from npmjs repository:
$ npm i -g @spedn/cli
Your first contract
Create a file mycontract.spedn with a following content:
contract ExpiringTip(Ripemd160 alice, Ripemd160 bob) {
challenge receive(Sig sig, PubKey pubKey) {
verify hash160(pubKey) == bob;
verify checkSig(sig, pubKey);
}
challenge revoke(Sig sig, PubKey pubKey) {
verify checkSequence(7d);
verify hash160(pubKey) == alice;
verify checkSig(sig, pubKey);
}
}
Compile with command:
$ spedn compile -c mycontract.spedn
You should get a compiled contract template similar to this:
<alice> <bob> 2 PICK TRUE EQUAL IF 3 PICK HASH160 OVER EQUALVERIFY (...)