Create Hash Puzzle
$
Want to create hash puzzles programatically in your application?
Creating hash puzzles programatically to use in your applications is easy. Hashes can be anything, Bitcoin TXIDs, other Magic Numbers, hashed content, etc... here's an example using MoneyButton:
// dd0fx57 = sha256("PoW Market Create Tutorial");
const hash = "dd0fba03e202a5d42e4546fb5b2753603cc7926bd797a1349d0efcaef873a057";
const target = "1f44d0"; // 👍
const mb = document.getElementById("money-button");
moneyButton.render(mb, {
outputs: [{
"script": `${hash} ${target} OP_SIZE OP_4 OP_PICK OP_SHA256 OP_SWAP OP_SPLIT OP_DROP OP_EQUALVERIFY OP_DROP OP_CHECKSIG`,
"amount": amount,
"currency": "USD",
}],
"onPayment": function(response) {
console.log("SUCCESS", response.txid);
},
"onError": function(e) {
console.log("ERROR", e);
},
});
Add more outputs that use BOB, Magic Attribute Protocol and BMAPjs to have your content automatically indexed on PoW Market.