const c = console const http = require('axios') const time = require('moment') const address = "12RXhCqxnXgJyfJLL2mvcqT3jCQ2o6rMAR" const main_tx = "6ccb90813afb1ef86cf778be68d43f2625352a03791b22aa4cdb9fbf622a108b" // Data available when reading data at BTC addres 12RXhCqxnXgJyfJLL2mvcqT3jCQ2o6rMAR (${address}) - you can use this runkit / nodejs script to generate the json or directly call it here - https://runkit.com/makevoid/blockchain-contract // // let ctr = require('@runkit/makevoid/blockchain-contract/3.0.0') // let ctr = '{"contract":{"marriage":["Kristina Butkute","Francesco Canessa"]},"timestamp":"2016-10-29 1:30 PM UTC","location":"Tower Hamlets public hall, London, UK","signatures":["FC","KB"],"contract_scan_sha2":"WILL_PROVIDE","contract_scan":{"http":"WILL_UPLOAD","torrent":"WU","ipfs":"WU"},"location_coords":{"lat":"51.527952","lng":"-0.019323"},"image_files":["marriage_certificate.jpg"],"github_usernames":["makevoid","kristinab"],"eid_1":"CANESSA,FRANCESCO,38706040087","eid_sig_1":{"FC":"48ddf18e4ec4fbccf7403d01bd83abdd26f7afb4ff5"},"eid_2":"BUTKUTE,KRISTINA,48511110100","void_address":"14EUVdBzCnAqm872XyeCThzG4hsgjZ9NB9","eid_sig_2":{"KB":"5632e93da14fbe30580b0daae4c927878fd8337226c"},"h":"abc96bfe2ca6966ab3ad20044907fac1573684d6eae66a489f92c8ccc88e8e81","cert_http":"http://mkvd.s3.amazonaws.com/marriage_certificate.jpg","torrent":"a4e79d1b4531dcb1d99c34fd6aad30241b95d976&amp;dn=m%5Fcert.jpg","ipfs":"Qmcq9Epj1qNFwseojUAXYqwQGgw45Q4Xwfg7WsM7za3xBV","contract_end":true}' // let ctr = require @runkit ctr = JSON.parse(ctr) c.log(ctr) let firstKey = (obj) => { return Object.keys(obj)[0] } let firstValue = (obj) => { return obj[firstKey(obj)] } let capitalize = (str) => { let tail = str.toString().substr(1) return `${str[0].toUpperCase()}${tail}` } let ghLinks = (usernames) => { return usernames.map((username) => { return `<a href="https://github.com/${username}">${username}</a>` }).join(", ") } let ghImages = (details) => { return details.map((detail) => { let image = detail.avatar_url return ` <div class="column-nah"> <img src="${image}" style="width: 200px; float:left; margin-right: 20px;" /> </div> ` }).join(" ") } let arrPrint = (arr) => { return arr.join(", ") } let arrStringFmt = (str) => { return str.split(",").join(", ") } // --------------------- // request data (inline using async) let ghDetails = [] for (username of ctr.github_usernames) { let url = `https://api.github.com/users/${username}` let resp = await http.get(url) ghDetails.push(resp.data) } const tx_link = (tx) => { let url = `https://chainflyer.bitflyer.jp/Transaction/${tx}` return `<a href='${url}'>${tx}</a>` } // // --------------------- // view layer const gpsCoordsCsv = `${ctr.location_coords.lat}, ${ctr.location_coords.lng}` const contractTitle = ` <h2 class="subtitle" style="margin-bottom: 25px;">${capitalize(firstKey(ctr.contract))}:</h2> <h1 class="title">${arrPrint(firstValue(ctr.contract))}</h1>` // cdn default bulma: https://cdnjs.cloudflare.com/ajax/libs/bulma/0.2.3/css/bulma.min.css const view = ` <html><head> <link rel="stylesheet" href="https://dl.dropbox.com/s/ey8p6kgsln720wp/bulma.css"> <style type="text/css"> .s10 { height: 10px; display: block; } .s20 { height: 20px; display: block; } .s30 { height: 30px; display: block; } .s40 { height: 40px; display: block; } .s50 { height: 50px; display: block; } .clear { clear: both; } p { word-break: break-all; } </style> <link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.1/dist/leaflet.css" /> </head><body> <div class="container is-fluid"> <section class="hero is-primary is-bold"> <div class="hero-body"> <div class="container"> <h1 class="title"> ${contractTitle} </h1> <h2 class="subtitle"> Blockchain OP_RETURN Contract <br> <a href="https://chainflyer.bitflyer.jp/Transaction/${main_tx}">${main_tx}</a> </h2> </div> </div> </section> <div class="box"> <h3 class="title is-3">Details:</h3> <h3 class="title is-5">Github usernames:</h3> <h3 class="title is-4"> ${ghLinks(ctr.github_usernames)} </h3> <div class="s40"></div> ${ghImages(ghDetails)} <div class="clear"></div> <div class="s40"></div> <h3 class="title is-5">When:</h3> <h3 class="title is-4">${time(ctr.timestamp).fromNow()}</h3> <pre><code>coordinates: ${JSON.stringify(ctr.location_coords)}</pre></code> <!-- blocks ago : https://chainflyer.bitflyer.jp/Transaction/da0a343c1d715fc90bd5db73e8ded12d99bf6e0f9bc2b4b73644dfe17cfafe9e TODO --> <div class="s20"></div> <div class="s40"></div> <h3 class="title is-5">Where:</h3> <h3 class="title is-4"> <a href="https://www.google.co.uk/maps/search/${ctr.location}"> ${ctr.location} </a> </h3> <pre><code>coordinates: ${JSON.stringify(ctr.location_coords)}</pre></code> <div class="s20"></div> <div id="map" style="width: 350px; height: 150px;"></div> <div class="s40"></div> <h3 class="title is-5">Identities</h3> <h3 class="title is-4">FC: ${arrStringFmt(ctr.eid_1)}</h3> <h3 class="title is-4">KB: ${arrStringFmt(ctr.eid_2)}</h3> <p>Estonian E-Residency Cards IDS</p> <div class="s40"></div> <h3 class="title is-5">Signatures</h3> <h3 class="title is-4">FC:</h3> <pre><code>48ddf18e4ec4fbccf7403d01bd83abdd26f7afb4ff5cdc45a10e6b6cea8e24f6 57622694120aab0d77e6aeeefbfc914b42e56f7f85782d48897d792f3581b1b0 2e8622312cc2b620b5296ae2ecd2a9dcdc79029a1fc9deaa4f7ea2a7692f5669 8dc222b679c5af9b9363e0613802d26994a16a648de9fe4b9f304a2ca678ff00 4db0644a63e73cda266621f7f113e692fa809fa1d4bcc377c476f6880aecc09f 3c31d42844869e913e3ff4181d18b973ba0d6d5ae48ab805811a7c6800c6bfc6 8c31fb014379ffe37647cd528e3d6a9fcba9e16381e84aa53882403ec99516ed cf06e8ce4f94847f02ee0af15fc36c0597c4c743438452c559fcc979c03abd18</pre></code> <p>tx: ${tx_link("7415c936440bdcffef1dac41a88c7a6962a857a138af455c85f9c39043a93a32")} - ${tx_link("c5cdacd21b8a542450e005c7485a565b48c1643d8db5302860d5f377f5fa8ba4")}</p> <div class="s40"></div> <h3 class="title is-4">KB:</h3> <pre><code>5632e93da14fbe30580b0daae4c927878fd8337226c2b60d79b73699ee101014 2b1a4e62c0c90f4467e86b2aba9b2935da5ce9af4b43f8ea6105baa6b1c7bed7 1d68781a674fbb11c419a7ff4103cee33840b8a8f685376d36c2a1d024384196 751b7c83dfacf464704a35a38328443b984e87edafdae7533e121aedb5212d4f 7ed5451576244e02b4f431f39b3533ad6a37ba3293128b5e41db01c0cad54e37 0dfd01199ebb8750526d4950455d2b9288626cdef5dcc2fc8c30e4a27cd6c6b0 6abb38a33020e2f453dec094468cf74c17120ba33fb3e594bdbe1904d7b28c11 aad29f1553cb405c883d1e7a6bfc612f82610ecbb64b90c2d26c232583c27fff</pre></code> <p>tx: ${tx_link("3fffd319ab4c63f0c8446d06992e9619c496283e58c56f26e8590406da6faf92")} - ${tx_link("28cdfbbb1fa8aea42a0c3c49a0742a746d3f27b35fd9c9136f7b5704e9425464")}</p> <div class="s20"></div> <p>The digital identities and signatures were performed using <a href="https://e-estonia.com/e-residents/about/">Estonian e-Residency ID cards</a> - <a href="http://www.id.ee/">ee.id</a> .</p> <div class="s40"></div> <h3 class="title is-5">Certificate (image URL)</h3> <h3 class="title is-4"> <a href="http://mkvd.s3.amazonaws.com/marriage_certificate.jpg"> <img src="http://mkvd.s3.amazonaws.com/marriage_certificate.jpg" /> </a> </h3> <p>${tx_link("cf6d13fb04aff41390c213dc89a0d1027cd42fc23d3659114296b6172ee85575")}</p> <div class="s40"></div> <h3 class="title is-5">Certificate (torrent - magnet link)</h3> <h3 class="title is-4"><pre><code> ${ctr.torrent} </pre></code></h3> <h3><a href="magnet:?xt=urn:btih:${ctr.torrent}&tr=http%3A%2F%2Fexplodie.org%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker4.piratux.com%3A6969%2Fannounce&tr=http%3A%2F%2Fretracker.krs-ix.ru%3A80%2Fannounce">magnet link - magnet:?xt=urn:btih:${ctr.torrent}</a></h3> <div class="s40"></div> <h3 class="title is-5">Certificate (ipfs)</h3> <h3 class="title is-4"><pre><code> ${ctr.ipfs} </pre></code></h3> <div class="s40"></div> <h3 class="title is-5">Certificate PoE (image hash - SHA256)</h3> <h3 class="title is-4"><pre><code>${ctr.h}</pre></code></h3> <div class="s40"></div> <h3 class="title is-5">BTC Address</h3> <h3 class="title is-4"> <a href="https://chainflyer.bitflyer.jp/Address/${address}"> ${address} </a> </h3> <p>Void (divorce) Address: ${ctr.void_address}</p> <h3 class="title is-5">EE.id certificate</h3> <pre><code> MIIFnTCCA4WgAwIBAgIQeupYRUf4Fc1YBctRq+89yTANBgkqhkiG9w0BAQsFADBj MQswCQYDVQQGEwJFRTEiMCAGA1UECgwZQVMgU2VydGlmaXRzZWVyaW1pc2tlc2t1 czEXMBUGA1UEYQwOTlRSRUUtMTA3NDcwMTMxFzAVBgNVBAMMDkVTVEVJRC1TSyAy MDE1MB4XDTE2MTAxODA3MTIxN1oXDTE5MTAxNzIwNTk1OVowgbExCzAJBgNVBAYT AkVFMSQwIgYDVQQKDBtFU1RFSUQgKERJR0ktSUQgRS1SRVNJREVOVCkxGjAYBgNV BAsMEWRpZ2l0YWwgc2lnbmF0dXJlMSUwIwYDVQQDDBxCVVRLVVRFLEtSSVNUSU5B LDQ4NTExMTEwMTAwMRAwDgYDVQQEDAdCVVRLVVRFMREwDwYDVQQqDAhLUklTVElO QTEUMBIGA1UEBRMLNDg1MTExMTAxMDAwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw ggEKAoIBAQCdby7l+gWYG/upajqORjtk7mp9v2aYEO3ci7OCLl3RSaPt1Kne6ETJ aUrmK+aqwTDAtjVexob8sSxoVLTe4qBnH5jjss38dG/G+u8vaE20y2cPgnGVHx50 bg3TwXqrhNrcXtOV4D3aH7abt/lpNhIUzIT2HnlPyiL58MhqKjfCYvB3jwtDV9QY R++JQJ0eFbJ0BWK/SnCb/xTznh4/u+7fiH1ii/RJ3BzgtP362qYWw9hUTeKFQf6d quTzvXNjGkTeMiAwusa6RvlMN56L6RvB5Mbubkq1OwyO/6CEUHc9YGj3po+OpWsO m4Gpb9rC7m0jkDbvSqgvQuSw7isl7431AgMBAAGjgf0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"></div> <h3 class="title is-5">Bonus: Blockchain Rings</h3> <h3 class="title is-4"><a href="http://mkvd.s3.amazonaws.com/kbfc/bchain_rings1.jpg"><img src="http://mkvd.s3.amazonaws.com/kbfc/bchain_rings1.jpg" /></a></h3> <p>tx: ${tx_link("bf3f56e26209007130346d50ccb078035f3b2ff10419ff6de1999f69fae4e89a")} </p> <div class="s20"></div> <p>All pictures (blockchain rings): <a href="http://mkvd.s3.amazonaws.com/kbfc/bchain_rings.zip">mkvd.s3.amazonaws.com/kbfc/bchain_rings.zip</a> - ${tx_link("bd3b0c27a69e43c7bdce2444c49f96170f539d43035f3eb95877c0cfb89e620c")} </p> <div class="s20"></div> <p> <a href="https://chainflyer.bitflyer.jp/Address/12RXhCqxnXgJyfJLL2mvcqT3jCQ2o6rMAR">All OP_RETURNS</a> (in reverse order) </p> <div class="s20"></div> <p> <a href="https://chainflyer.bitflyer.jp/Address/14EUVdBzCnAqm872XyeCThzG4hsgjZ9NB9">Void Address - 14EUVdBzCnAqm872XyeCThzG4hsgjZ9NB9</a> ( hopefully we will never need to use the OP RETURN of this address :) ) </p> <div class="s10"></div> <p> tx: ${tx_link("f7f076e020e208459a9b89a1198d7f423ae3e0aec63bb4aeeb3b9bcf8af8ccac")} </p> <div class="s20"></div> <p>Our message:</p> <p>${tx_link("48d4c59df312afcac59378fdee5061036cbfd3cfeb6559a1ad897ed26c9fd319")} </p> </div> </div> <script type="text/javascript" src="https://unpkg.com/leaflet@1.0.1/dist/leaflet.js"></script> <script src="https://unpkg.com/esri-leaflet@2.0.4"></script> <script type="text/javascript"> document.addEventListener("DOMContentLoaded", function(event) { var L = window.L var map = L.map('map').setView([${gpsCoordsCsv}], 8); // var id = "mapbox.streets" // // 'https://{s}.tile.osm.org/{z}/{x}/{y}.png' // https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png //'https://api.tiles.mapbox.com/v4/mapbox.streets/{z}/{x}/{y}.png' // https://a.tile.openstreetmap.org/{z}/{x}/{y}.png // 'https://otile2-s.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.png' // var tiles = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png' // L.tileLayer(tiles, { // attribution: '' // }).addTo(map); L.marker([${gpsCoordsCsv}]).addTo(map) }) </script> </body> ` /* to add a new section in the html <div class="s40"></div> <h3 class="title is-5"></h3> <h3 class="title is-4">${''}</h3> */ view

2 comments

  • posted 8 months ago by 5818f4a97f47d000133fc311
    Congrats!
  • posted 22 days ago by amazingandyyy
    cool

sign in to comment

running