<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title></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="http:&#x2F;&#x2F;localhost:8080&#x2F;juice.css">
    
    
</head>

<body>
    

    <header class="pos-absolute" style="background-color: transparent">
        

<a href="http:&#x2F;&#x2F;localhost:8080&#x2F;">
    <div class="logo">
        <img src="http:&#x2F;&#x2F;localhost:8080&#x2F;gradecoin.png" alt="logo">
        Gradecoin
    </div>
</a>

<nav>
    
    <a class="nav-item subtitle-text" href="http:&#x2F;&#x2F;localhost:8080&#x2F;block-docs&#x2F;">Blocks</a>
    
    <a class="nav-item subtitle-text" href="http:&#x2F;&#x2F;localhost:8080&#x2F;transaction-docs&#x2F;">Transactions</a>
    
    <a class="nav-item subtitle-text" href="http:&#x2F;&#x2F;localhost:8080&#x2F;register-docs&#x2F;">Register</a>
    
    <a class="nav-item subtitle-text" href="http:&#x2F;&#x2F;localhost:8080&#x2F;jwt&#x2F;">JWT</a>
    
    
        
        <a class="nav-item subtitle-text" href="https:&#x2F;&#x2F;github.com&#x2F;zhuowei&#x2F;nft_ptr#why">why?</a>
        
    
</nav>

    </header>

    <div class="hero">
        
<section class="text-center">
    <h1 class="heading-text" style="font-size: 50px">
        Mine your own grades
    </h1>
    <h3 class="title-text">
        <b style="color: deepskyblue">Gradecoin</b> is the latest cutting edge blockchain technology agile grading framework that drives organic engagement and other buzzwords, with big data mining search engine optimization
    </h3>
    <div>
        <!-- <a class="github-button" href="https://github.com/huhu/juice" data-size="large" data-show-count="true" -->
        <!--                                                                                 aria-label="Star huhu/juice on GitHub">Star</a> -->
        <!-- <a class="github-button" href="https://github.com/huhu/juice/fork" data-size="large" -->
        <!--                                                                    data-show-count="true" aria-label="Fork huhu/juice on GitHub">Fork</a> -->
    </div>
</section>
<img class="hero-image" style="width: 50%" src="http:&#x2F;&#x2F;localhost:8080&#x2F;gradecoin.png">

<div class="explore-more text"
     onclick="document.getElementById('features').scrollIntoView({behavior: 'smooth'})">
    ⇩ Learn How ⇩
</div>
<style>
.hero section {
    padding: 0 5rem;
}
                    @media screen and (max-width: 768px) {
                        .hero section {
                            padding: 0 2rem;
                        }

                    .hero-image {
                        display: none
                    }
                }
</style>

    </div>

    

    <main>
        
        
        
        
        
        <div class="toc">
            <div class="toc-sticky">
                
                <div class="toc-item">
                    <a class="subtext" href="http://localhost:8080/#services">Services</a>
                </div>
                
                
                <div class="toc-item-child">
                    <a class="subtext" href="http://localhost:8080/#register"><small>- &#x2F;register</small></a>
                </div>
                
                <div class="toc-item-child">
                    <a class="subtext" href="http://localhost:8080/#transaction"><small>- &#x2F;transaction</small></a>
                </div>
                
                <div class="toc-item-child">
                    <a class="subtext" href="http://localhost:8080/#block"><small>- &#x2F;block</small></a>
                </div>
                
                
                
            </div>
        </div>
        
        

        <div class="content text">
            
            <div id="features" class="heading-text">Overview</div>
            <ul>
<li>Don't know where to start? Gradecoin uses RESTful API, simple <code>curl</code> commands or even your browser will work! <a href="https://curl.trillworks.com/">This website can help as well</a>.</li>
<li><a href="https://jwt.io">JWT Debugger</a> and the corresponding <a href="https://tools.ietf.org/html/rfc7519">RFC</a></li>
</ul>
<h1 id="services">Services</h1>
<h2 id="register">/register</h2>
<ul>
<li>Student creates their own 2048 bit RSA <code>keypair</code></li>
<li>Downloads <code>Gradecoin</code>'s Public Key from <a href="https://odtuclass.metu.edu.tr/my/">Moodle</a></li>
<li>Encrypts their JSON wrapped <code>Public Key</code>, <code>Student ID</code> and one time <code>passwd</code> using Gradecoin's Public Key</li>
<li>Their public key is now in our database and can be used to sign their JWT's during requests</li>
</ul>
<h2 id="transaction">/transaction</h2>
<ul>
<li>You can offer a <a href="/transaction">Transaction</a> - POST request
<ul>
<li>The request should have <code>Authorization</code></li>
<li>The request header should be signed by the Public Key of the <code>by</code> field in the transaction</li>
</ul>
</li>
<li>fetch the list of <code>Transaction</code>s - GET request</li>
</ul>
<h2 id="block">/block</h2>
<ul>
<li>offer a [<code>schema::Block</code>] - POST request
<ul>
<li>The request should have <code>Authorization</code></li>
<li>The [<code>schema::Block::transaction_list</code>] of the block should be a subset of [<code>schema::Db::pending_transactions</code>]</li>
</ul>
</li>
<li>fetch the last accepted [<code>schema::Block</code>] - GET request</li>
</ul>
<p><code>Authorization</code>: The request header should have Bearer JWT.Token signed with Student Public Key</p>

            
        </div>

        
        
    </main>

    
<footer>
    ⁂
</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>