<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Syed Ali Hasan Moosavi</title>
    <description>The latest articles on DEV Community by Syed Ali Hasan Moosavi (@shalimoosavi).</description>
    <link>https://dev.to/shalimoosavi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3999776%2Fb8a0352c-7025-4561-8bd9-db96823c6eb9.png</url>
      <title>DEV Community: Syed Ali Hasan Moosavi</title>
      <link>https://dev.to/shalimoosavi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shalimoosavi"/>
    <language>en</language>
    <item>
      <title>Building an Independent Layer-1 Blockchain From Scratch — SAYANJALI BLOCKCHAIN v0.1.0-mvp published</title>
      <dc:creator>Syed Ali Hasan Moosavi</dc:creator>
      <pubDate>Sat, 11 Jul 2026 07:21:20 +0000</pubDate>
      <link>https://dev.to/shalimoosavi/building-an-independent-layer-1-blockchain-from-scratch-sayanjali-blockchain-v010-mvppublished-jpc</link>
      <guid>https://dev.to/shalimoosavi/building-an-independent-layer-1-blockchain-from-scratch-sayanjali-blockchain-v010-mvppublished-jpc</guid>
      <description>&lt;p&gt;&lt;strong&gt;Most projects that describe themselves as "blockchain" are a smart&lt;br&gt;
contract deployed on Ethereum, Solana, or a similar host network.&lt;/strong&gt; That's&lt;br&gt;
often the right call — you inherit a mature validator set, existing&lt;br&gt;
tooling, and liquidity on day one.&lt;br&gt;
It also means you inherit that network's fee market, its execution&lt;br&gt;
constraints, and its governance. Your token's economics are ultimately&lt;br&gt;
subject to decisions you don't make.&lt;br&gt;
For &lt;strong&gt;SAYANJALI NEXUS&lt;/strong&gt;, I wanted the settlement layer for the SYJ&lt;br&gt;
Token to be a protocol we actually control end to end — its own block&lt;br&gt;
format, its own consensus rules, its own upgrade path. That means building&lt;br&gt;
a chain, not a contract.&lt;br&gt;
This post covers what &lt;strong&gt;shipped in v0.1.0-mvp&lt;/strong&gt;, the architectural&lt;br&gt;
decisions behind it, and what's intentionally not in this release yet.&lt;br&gt;
&lt;strong&gt;Repository: github.com/SHalimoosavi/SAYANJALI-BLOCKCHAIN&lt;/strong&gt;&lt;br&gt;
Scope of this release&lt;br&gt;
An MVP is a bad place to cut corners on fundamentals and a good place to&lt;br&gt;
defer everything else. So this release focuses entirely on getting the&lt;br&gt;
core primitives correct and tested, and defers anything that depends on&lt;br&gt;
a live network of peers:&lt;br&gt;
&lt;strong&gt;Included:&lt;br&gt;
Block model, SHA-256 hashing, Merkle-root transaction integrity&lt;br&gt;
Full chain validation from genesis to tip&lt;br&gt;
Proof-of-Work consensus with configurable difficulty&lt;br&gt;
ECDSA (SECP256k1) wallets&lt;br&gt;
Signed, independently verifiable transactions&lt;br&gt;
A mempool with duplicate and signature validation&lt;br&gt;
SQLAlchemy-backed persistence&lt;br&gt;
A FastAPI REST interface and a Typer CLI&lt;br&gt;
37 automated tests&lt;br&gt;
Deliberately deferred:&lt;br&gt;
Peer-to-peer networking&lt;br&gt;
Proof of Stake&lt;br&gt;
Smart contract execution&lt;br&gt;
A block explorer&lt;br&gt;
Governance tooling&lt;/strong&gt;&lt;br&gt;
Every deferred item is architected for — not bolted on later. That distinction shows up in a few specific design choices worth walking through.&lt;br&gt;
Design decision: header-only block hashing&lt;br&gt;
A block's hash only covers its header fields — index, previous hash, timestamp, nonce, difficulty, and Merkle root — not the full transaction&lt;br&gt;
List: &lt;br&gt;
**def header_payload(self) -&amp;gt; dict[str, Any]:&lt;br&gt;
    return {&lt;br&gt;
        "index": self.index,&lt;br&gt;
        "previous_hash": self.previous_hash,&lt;br&gt;
        "timestamp": self.timestamp,&lt;br&gt;
        "nonce": self.nonce,&lt;br&gt;
        "difficulty": self.difficulty,&lt;br&gt;
        "merkle_root": self.merkle_root,&lt;br&gt;
    }&lt;/p&gt;

&lt;p&gt;def compute_hash(self) -&amp;gt; str:&lt;br&gt;
    return sha256(deterministic_json(self.header_payload()))**&lt;/p&gt;

&lt;p&gt;Mining repeatedly re-hashes the header on every nonce attempt, so keeping that payload small and fixed-size means mining cost stays independent of block size. Transaction integrity is still fully guaranteed, because the&lt;br&gt;
Merkle root is itself part of the header — any change to any transaction changes the Merkle root, which changes the hash.&lt;br&gt;
Design decision: difficulty lives inside the block &lt;br&gt;
Difficulty in most tutorial-grade blockchain implementations is a global config value, checked externally against whatever the block claims. That creates an awkward problem the moment difficulty legitimately changes over time: how do you validate historical blocks that were mined under a different difficulty than the one your config currently holds?&lt;br&gt;
*&lt;em&gt;**SAYANJALI BLOCKCHAIN records difficulty as a field on the block itself,&lt;br&gt;
and that field is part of the hashed header — so it can't be tampered with&lt;br&gt;
independently of the block's&lt;/em&gt;* hash:**&lt;br&gt;
Python: &lt;br&gt;
**def mine(self, block: Block, difficulty: int) -&amp;gt; Block:&lt;br&gt;
    target_prefix = "0" * difficulty&lt;br&gt;
    block.nonce = 0&lt;br&gt;
    block.difficulty = difficulty&lt;br&gt;
    block.recompute()&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;while not block.hash.startswith(target_prefix):
    block.nonce += 1
    block.recompute()

return block
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;**&lt;br&gt;
Validation then checks a block against its own recorded difficulty (authenticated by the hash) rather than a single static expectation, which lets difficulty retarget over the network's history without&lt;br&gt;
invalidating blocks mined before the retarget.&lt;br&gt;
Design decision: consensus behind an interface Consensus-Engine is an abstract base class with one implementation today:&lt;br&gt;
Python: class Consensus **Engine(ABC):&lt;br&gt;
    &lt;a class="mentioned-user" href="https://dev.to/abstractmethod"&gt;@abstractmethod&lt;/a&gt;&lt;br&gt;
    def mine(self, block: Block, difficulty: int) -&amp;gt; Block: ...&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@abstractmethod
def validate(self, block: Block, difficulty: int) -&amp;gt; bool: ...

@abstractmethod
def next_difficulty(
    self, previous_blocks: list[Block],
    config_difficulty: int, target_block_time: int,
) -&amp;gt; int: ...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;**&lt;br&gt;
&lt;strong&gt;Proof Of Work Consensus&lt;/strong&gt; implements it now. Proof of Stake or Delegated&lt;br&gt;
Proof of Stake become new classes implementing the same interface —&lt;br&gt;
nothing in the orchestrator, API, or CLI needs to change to support them.&lt;br&gt;
Design decision: storage abstraction, not a database driver Persistence is built on SQLAlchemy Core rather than raw sqlite3 calls.&lt;/p&gt;

&lt;p&gt;The MVP ships with SQLite because it needs zero infrastructure to run, but the entire storage layer talks to SQLAlchemy's engine interface — moving to PostgreSQL later is a one-line change to a connection string, not a&lt;br&gt;
*&lt;em&gt;rewrite of storage.py:&lt;br&gt;
Python: &lt;br&gt;
@property&lt;br&gt;
def database_url(self) -&amp;gt; str:&lt;br&gt;
    self.database_dir.mkdir(parents=True, exist_ok=True)&lt;br&gt;
    return f"sqlite:///{self.database_dir / self.database_file}"&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
What operating a node looks like&lt;br&gt;
Two interfaces, one underlying chain implementation — the REST API and the CLI both call into the same Blockchain facade, so there's exactly one source of truth for how the chain behaves.&lt;br&gt;
**CLI:&lt;br&gt;
Bash: &lt;br&gt;
python -m cli.main create-wallet&lt;br&gt;
python -m cli.main mine &lt;/p&gt;
&lt;br&gt;
python -m cli.main show-chain&lt;br&gt;
python -m cli.main validate

&lt;p&gt;REST API : &lt;br&gt;
Bash:&lt;br&gt;
uvicorn api.main:app --host 0.0.0.0 --port 8000&lt;/p&gt;

&lt;p&gt;curl -X POST &lt;a href="http://127.0.0.1:8000/wallet/create" rel="noopener noreferrer"&gt;http://127.0.0.1:8000/wallet/create&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;curl -X POST &lt;a href="http://127.0.0.1:8000/mine" rel="noopener noreferrer"&gt;http://127.0.0.1:8000/mine&lt;/a&gt; \&lt;br&gt;
  -H "Content-Type: application/json" \&lt;br&gt;
  -d '{"miner_address": "&lt;/p&gt;"}'

&lt;p&gt;curl &lt;a href="http://127.0.0.1:8000/status" rel="noopener noreferrer"&gt;http://127.0.0.1:8000/status&lt;/a&gt;&lt;br&gt;
**&lt;br&gt;
Swagger docs are generated automatically at /docs.&lt;br&gt;
Testing&lt;br&gt;
37 tests cover wallets, transactions, blocks, mining, chain validation,&lt;br&gt;
and the full REST API via FastAPI's TestClient, each running against an&lt;br&gt;
isolated temporary SQLite database:&lt;br&gt;
&lt;strong&gt;Bash : pytest -v&lt;br&gt;
37 passed in 1.2s&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Two bugs the test suite actually caught during development, worth&lt;br&gt;
mentioning because they're the kind of thing that's easy to miss in a from-scratch implementation:&lt;br&gt;
A validation/mining mismatch — mining used a dynamically retargeted difficulty, but chain validation checked against one static config value, so a chain that had legitimately retargeted would fail its own validation. Fixed by recording difficulty per block, as described above.&lt;br&gt;
A coinbase tamper gap — coinbase (mining reward) transactions carry no signature, so nothing was verifying their amount field hadn't been altered after the transaction hash was computed. Fixed by having Transaction.verify() check the transaction's hash against a fresh recomputation, catching any post-hash tampering regardless of whether a signature exists.&lt;br&gt;
Both are the kind of thing you only find by actually mining blocks, tampering with them, and asserting the chain rejects the tampering — not by reading the code.&lt;br&gt;
&lt;strong&gt;What's next&lt;br&gt;
Phase&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Scope&lt;/strong&gt; &lt;br&gt;
6 Peer-to-peer networking, multi-node synchronization&lt;br&gt;
7 Full difficulty retargeting, Proof-of-Stake groundwork&lt;br&gt;
8 Block explorer&lt;br&gt;
9 Smart contract execution&lt;br&gt;
10 Governance, SDK&lt;br&gt;
11 Mainnet, SYJ Token launch&lt;br&gt;
*&lt;em&gt;Try it&lt;br&gt;
Bash : &lt;br&gt;
git clone &lt;a href="https://github.com/SHalimoosavi/SAYANJALI-BLOCKCHAIN.git" rel="noopener noreferrer"&gt;https://github.com/SHalimoosavi/SAYANJALI-BLOCKCHAIN.git&lt;/a&gt;&lt;br&gt;
cd SAYANJALI-BLOCKCHAIN&lt;br&gt;
python -m venv venv &amp;amp;&amp;amp; source venv/bin/activate&lt;br&gt;
pip install -r requirements.txt&lt;br&gt;
python -m cli.main create-wallet&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
This is an MVP — unaudited, not production-ready, and built to be read and reviewed rather than taken on faith. If you work on consensus systems, distributed storage, or Python infrastructure, I'd genuinely value a look at the design decisions above. Issues, forks, and pull requests are all&lt;br&gt;
welcome.&lt;/p&gt;

&lt;p&gt;Repository: &lt;strong&gt;&lt;a href="https://github.com/SHalimoosavi/SAYANJALI-BLOCKCHAIN" rel="noopener noreferrer"&gt;https://github.com/SHalimoosavi/SAYANJALI-BLOCKCHAIN&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
Release notes: &lt;strong&gt;&lt;a href="https://github.com/SHalimoosavi/SAYANJALI-BLOCKCHAIN/releases/tag/v0.1.0-mvp" rel="noopener noreferrer"&gt;https://github.com/SHalimoosavi/SAYANJALI-BLOCKCHAIN/releases/tag/v0.1.0-mvp&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsmntbdbd6kn5vn60e2y5.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsmntbdbd6kn5vn60e2y5.jpg" alt=" " width="800" height="1493"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbq3x31yga1cuei8wcx3a.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbq3x31yga1cuei8wcx3a.jpg" alt=" " width="800" height="1213"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>web3</category>
      <category>showdev</category>
      <category>opensource</category>
    </item>
    <item>
      <title>I'm Building a Blockchain Ecosystem From Scratch — Here's Everything I've Shipped So Far</title>
      <dc:creator>Syed Ali Hasan Moosavi</dc:creator>
      <pubDate>Wed, 24 Jun 2026 04:55:00 +0000</pubDate>
      <link>https://dev.to/shalimoosavi/im-building-a-blockchain-ecosystem-from-scratch-heres-everything-ive-shipped-so-far-448o</link>
      <guid>https://dev.to/shalimoosavi/im-building-a-blockchain-ecosystem-from-scratch-heres-everything-ive-shipped-so-far-448o</guid>
      <description>&lt;p&gt;Most people talk about building. I ship.&lt;/p&gt;

&lt;p&gt;My name is &lt;strong&gt;Syed Ali Hasan Moosavi&lt;/strong&gt; — Founder and Managing Director of &lt;br&gt;
&lt;strong&gt;SAYANJALI NEXUS PRIVATE LIMITED&lt;/strong&gt;, a registered technology company based &lt;br&gt;
in Hyderabad, India.&lt;/p&gt;

&lt;p&gt;Over the past two years I've been quietly building an ecosystem of &lt;br&gt;
open-source tools, AI platforms, and enterprise systems — all converging &lt;br&gt;
toward one long-term vision: &lt;strong&gt;the SYJ Token utility layer on the &lt;br&gt;
SAYANJALI Blockchain&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This is everything I've built, why I built it, and where it's all going.&lt;/p&gt;




&lt;h2&gt;
  
  
  What's Already Shipped
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🔷 NexusRank AI
&lt;/h3&gt;

&lt;p&gt;An AI-powered SEO intelligence SaaS. Keyword tracking, competitor &lt;br&gt;
analysis, rank monitoring — built for agencies and businesses that need &lt;br&gt;
real data, not guesswork.&lt;/p&gt;

&lt;p&gt;→ &lt;a href="https://github.com/SHalimoosavi/NexusRank-AI" rel="noopener noreferrer"&gt;github.com/SHalimoosavi/NexusRank-AI&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🔷 SYJ Deploy
&lt;/h3&gt;

&lt;p&gt;A self-hosted PaaS that deploys Python applications in under 10 seconds. &lt;br&gt;
No AWS. No Vercel. No vendor lock-in. You own the infrastructure, you own &lt;br&gt;
the data.&lt;/p&gt;

&lt;p&gt;This exists because my enterprise clients — hospitals, logistics firms, &lt;br&gt;
Gulf-based companies — need their systems on infrastructure they control. &lt;br&gt;
Not someone else's cloud.&lt;/p&gt;

&lt;p&gt;→ &lt;a href="https://github.com/SHalimoosavi/syj-deploy" rel="noopener noreferrer"&gt;github.com/SHalimoosavi/syj-deploy&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🔷 SYJ Scholar AI
&lt;/h3&gt;

&lt;p&gt;An AI-powered Islamic hadith research platform built with strict Akhbari &lt;br&gt;
theological sourcing constraints. Every response is traceable to verified &lt;br&gt;
sources. No hallucinations on sacred text — the system is architecturally &lt;br&gt;
prevented from guessing.&lt;/p&gt;

&lt;p&gt;→ &lt;a href="https://github.com/SHalimoosavi/SYJ-SCHOLAR-AI" rel="noopener noreferrer"&gt;github.com/SHalimoosavi/SYJ-SCHOLAR-AI&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🔷 SYJ WebSense AI
&lt;/h3&gt;

&lt;p&gt;Web intelligence and automated research aggregation. Built for analysts, &lt;br&gt;
consultants, and OSINT workflows that need structured information from &lt;br&gt;
unstructured sources.&lt;/p&gt;

&lt;p&gt;→ &lt;a href="https://github.com/SHalimoosavi/SYJ-WebSense-AI" rel="noopener noreferrer"&gt;github.com/SHalimoosavi/SYJ-WebSense-AI&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🔷 SAYANJALI OSINT
&lt;/h3&gt;

&lt;p&gt;An open-source intelligence and recon toolkit for security researchers. &lt;br&gt;
Runs entirely from terminal. No GUI required.&lt;/p&gt;

&lt;p&gt;→ &lt;a href="https://github.com/SHalimoosavi/sayanjali-osint" rel="noopener noreferrer"&gt;github.com/SHalimoosavi/sayanjali-osint&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🔷 SYJ GitHub Optimizer
&lt;/h3&gt;

&lt;p&gt;Automates your entire GitHub presence — profile README generation, repo &lt;br&gt;
topic tagging, release creation — via the GitHub API. One command.&lt;br&gt;
Works on Linux, macOS, Windows, and Android.&lt;/p&gt;

&lt;p&gt;→ &lt;a href="https://github.com/SHalimoosavi/syj-github-optimizer" rel="noopener noreferrer"&gt;github.com/SHalimoosavi/syj-github-optimizer&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Vision: SYJ Token + SAYANJALI Blockchain
&lt;/h2&gt;

&lt;p&gt;Every tool I've shipped serves a specific market: developers, enterprises, &lt;br&gt;
researchers, security teams.&lt;/p&gt;

&lt;p&gt;The next layer connects them all.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SYJ Token&lt;/strong&gt; is the utility token of the SAYANJALI ecosystem — designed &lt;br&gt;
to power transactions, access, and governance across every product &lt;br&gt;
SAYANJALI NEXUS builds and operates.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SAYANJALI Blockchain&lt;/strong&gt; is the infrastructure it runs on — purpose-built &lt;br&gt;
for the use cases my clients actually have: document verification, &lt;br&gt;
compliance trails, supply chain integrity, and payment rails for &lt;br&gt;
Gulf-market enterprise workflows.&lt;/p&gt;

&lt;p&gt;This is not a whitepaper project. Every tool I've shipped above is a &lt;br&gt;
building block. SYJ Deploy handles infrastructure. NexusRank handles &lt;br&gt;
visibility. The OSINT toolkit handles intelligence. Scholar AI handles &lt;br&gt;
verified knowledge. The blockchain layer and token economy sit on top of &lt;br&gt;
all of it — connecting real products to real utility.&lt;/p&gt;

&lt;p&gt;The announcement is coming. The foundation is already built.&lt;/p&gt;




&lt;h2&gt;
  
  
  Follow the Build
&lt;/h2&gt;

&lt;p&gt;I ship in public. Every release, every tool, every update goes to GitHub &lt;br&gt;
first.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/SHalimoosavi" rel="noopener noreferrer"&gt;github.com/SHalimoosavi&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;CTO / Consulting:&lt;/strong&gt; &lt;a href="mailto:cto@sayanjalinexus.com"&gt;cto@sayanjalinexus.com&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;SYJ Token &amp;amp; Ventures:&lt;/strong&gt; &lt;a href="mailto:founders@syj-token.com"&gt;founders@syj-token.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you're building in AI, blockchain, or enterprise automation — or if &lt;br&gt;
you're a developer who wants to contribute to any of these open-source &lt;br&gt;
projects — reach out.&lt;/p&gt;

&lt;p&gt;The ecosystem is open. The build is live.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>blockchain</category>
      <category>ai</category>
      <category>buildinpublic</category>
    </item>
  </channel>
</rss>
