This is a simple smart-contract experiment with CashScript . The purpose of this experiment is to create a Vault that locks your funds without the need of a third party custody. The funds are locked until a PGP(HASH(secret code)) is available on the P2P Network for this Wallet. The Vault can be extended with the usage of multisig and a timeout that release the funds.
WARNING: The security is not the purpose of this project. This idea is a pretext to use CDS coupled with a custom PGP Oracle Provider
npm install -g ts-node
git clone https://github.com/evaletolab/bch-wallet-locker
cd bch-wallet-locker
npm install
ts-node locker-vault.ts
node locker-vault.js
First time you will get the error:
contract address: bchtest:pzd3jvwuqjwyrzm8xqks4k3l6wkyeygl5uthw875lp
contract balance: 0
--- ERR Error: Insufficient balance: available (0) < needed (1078).
- use the testnet faucet for Bitcoin Cash => https://developer.bitcoin.com/faucets/bch/