<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Transactions | Gradecoin </title> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <style> :root { /* Primary theme color */ --primary-color: #F8D12F; /* Primary theme text color */ --primary-text-color: #1E2329; /* Primary theme link color */ --primary-link-color: #2F57F7; /* Secondary color: the background body color */ --secondary-color: #FAFAFA; --secondary-text-color: #303030; /* Highlight text color of table of content */ --toc-highlight-text-color: #d46e13; } </style> <link href="https://fonts.googleapis.com/css?family=Alfa+Slab+One&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Fira+Sans:400,500,600&display=swap" rel="stylesheet"> <link rel="stylesheet" href="/normalize.css"> <link rel="stylesheet" href="https://gradecoin.xyz/juice.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css" /> <link rel="stylesheet" href="/site.css" /> </head> <body> <header class="box-shadow"> <a href="https://gradecoin.xyz/"> <div class="logo"> <img src="https://gradecoin.xyz/gradecoin.png" alt="logo"> Gradecoin </div> </a> <nav> <a class="nav-item subtitle-text" href="https://gradecoin.xyz/register-docs/">Register</a> <a class="nav-item subtitle-text" href="https://gradecoin.xyz/jwt/">JWT</a> <a class="nav-item subtitle-text" href="https://gradecoin.xyz/transaction-docs/">Transactions</a> <a class="nav-item subtitle-text" href="https://gradecoin.xyz/block-docs/">Blocks</a> <a class="nav-item subtitle-text" href="https://gradecoin.xyz/misc-docs/">Misc</a> <a class="nav-item subtitle-text" href="https://github.com/zhuowei/nft_ptr#why">why?</a> </nav> </header> <main> <div class="toc"> <div class="toc-sticky"> <div class="toc-item"> <a class="subtext" href="https://gradecoin.xyz/transaction-docs/#requests">Requests</a> </div> <div class="toc-item-child"> <a class="subtext" href="https://gradecoin.xyz/transaction-docs/#get"><small>- GET</small></a> </div> <div class="toc-item-child"> <a class="subtext" href="https://gradecoin.xyz/transaction-docs/#post"><small>- POST</small></a> </div> <div class="toc-item"> <a class="subtext" href="https://gradecoin.xyz/transaction-docs/#fields">Fields</a> </div> <div class="toc-item"> <a class="subtext" href="https://gradecoin.xyz/transaction-docs/#hash">Hash</a> </div> <div class="toc-item"> <a class="subtext" href="https://gradecoin.xyz/transaction-docs/#bank">Bank</a> </div> </div> </div> <div class="content text"> <div class="heading-text">Transaction documentation</div> <p>A transaction request between <code>source</code> and <code>target</code> to move <code>amount</code> Gradecoin.</p> <h1 id="requests">Requests</h1> <h2 id="get">GET</h2> <p>A HTTP <code>GET</code> request to <a href="/transaction">/transaction</a> endpoint will return the current list of pending transactions.</p> <h2 id="post">POST</h2> <p>A HTTP <code>POST</code> request with Authorization using JWT to <a href="/transactions">/transaction</a> will allow you to propose your own transactions.</p> <h1 id="fields">Fields</h1> <pre style="background-color:#ffffff;"> <code><span style="color:#545052;">by: Fingerprint source: Fingerprint target: Fingerprint amount: unsigned 16 bit integer timestamp: ISO 8601 <date>T<time> </span></code></pre><h1 id="hash">Hash</h1> <p><code>tha</code> field in <a href="https://gradecoin.xyz/jwt/">jwt documentation</a> in fact stands for "The Hash", in the case of a post request for a transaction, you need the Md5 hash of the serialized JSON representation of transaction.</p> <h1 id="bank">Bank</h1> <p>There is a <code>bank</code> account with Fingerprint <code>31415926535897932384626433832795028841971693993751058209749445923</code></p> <blockquote class="tidbit"> <p> First 64 digits of Pi </p> </blockquote> <p>This is the only account that will let you <em>withdraw</em> from them.</p> <pre style="background-color:#ffffff;"> <code><span style="color:#545052;">by: this has to be your Fingerprint source: this can be either you or the bank target: this can be a valid fingerprint or yourself if source is the bank ... </span></code></pre> </div> </main> <footer> Built For ⁂ CENG489 ⁂ Introduction to Computer Security </footer> </body> <script> function highlightNav(heading) { let pathname = location.pathname; document.querySelectorAll(".toc a").forEach((item) => { item.classList.remove("active"); }); document.querySelector(".toc a[href$='" + pathname + "#" + heading + "']").classList.add("active"); } let currentHeading = ""; window.onscroll = function () { let h = document.querySelectorAll("h1,h2,h3,h4,h5,h6"); let elementArr = []; h.forEach(item => { if (item.id !== "") { elementArr[item.id] = item.getBoundingClientRect().top; } }); elementArr.sort(); for (let key in elementArr) { if (!elementArr.hasOwnProperty(key)) { continue; } if (elementArr[key] > 0 && elementArr[key] < 300) { if (currentHeading !== key) { highlightNav(key); currentHeading = key; } break; } } } </script> </html>