<?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>Forem: Nkatha Kaburu</title>
    <description>The latest articles on Forem by Nkatha Kaburu (@nkatha_kaburu).</description>
    <link>https://forem.com/nkatha_kaburu</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3881932%2F0b283fd1-e3c0-4bfb-953c-ba1fea03d0e5.png</url>
      <title>Forem: Nkatha Kaburu</title>
      <link>https://forem.com/nkatha_kaburu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/nkatha_kaburu"/>
    <language>en</language>
    <item>
      <title>Bitcoin Core Guix Attestation Guide</title>
      <dc:creator>Nkatha Kaburu</dc:creator>
      <pubDate>Fri, 24 Apr 2026 15:59:17 +0000</pubDate>
      <link>https://forem.com/nkatha_kaburu/bitcoin-core-guix-attestation-guide-3cf8</link>
      <guid>https://forem.com/nkatha_kaburu/bitcoin-core-guix-attestation-guide-3cf8</guid>
      <description>&lt;p&gt;A practical guide to independently reproducing Bitcoin Core release binaries and submitting attestations to bitcoin-core/guix.sigs. Written from the experience of attesting v31.0 on Fedora Linux 43.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is Guix Attestation?**
&lt;/h2&gt;

&lt;p&gt;Bitcoin Core uses &lt;a href="https://guix.gnu.org/" rel="noopener noreferrer"&gt;Guix&lt;/a&gt; — a reproducible build system — to produce release binaries. Multiple independent builders compile Bitcoin Core from the same source tag and compare their SHA256 hashes. If hashes match across builders, it proves the official release binaries weren't tampered with.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The two-stage process:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Stage&lt;/th&gt;
&lt;th&gt;What happens&lt;/th&gt;
&lt;th&gt;Who does it&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;noncodesigned&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Compile from source, hash outputs&lt;/td&gt;
&lt;td&gt;Anyone with Linux/macOS&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;all&lt;/code&gt; (codesigned)&lt;/td&gt;
&lt;td&gt;Attach Windows/macOS code signatures&lt;/td&gt;
&lt;td&gt;Builders with Apple/Microsoft signing certs&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;As a community builder, you contribute &lt;strong&gt;noncodesigned&lt;/strong&gt; attestations. This is what most builders do. &lt;/p&gt;




&lt;h2&gt;
  
  
  Requirements
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Hardware:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;8GB RAM minimum (16GB recommended — the build is memory-intensive)&lt;/li&gt;
&lt;li&gt;50GB+ free disk space for a full multi-platform build&lt;/li&gt;
&lt;li&gt;x86_64 Linux machine&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Software:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Docker (tested with Docker 29.4.0)&lt;/li&gt;
&lt;li&gt;GPG (usually pre-installed)&lt;/li&gt;
&lt;li&gt;Git&lt;/li&gt;
&lt;li&gt;A GitHub account&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Accounts/Keys:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GitHub account&lt;/li&gt;
&lt;li&gt;GPG key (generated during setup)&lt;/li&gt;
&lt;li&gt;GitHub Personal Access Token (for pushing)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  One-Time Setup
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Generate a GPG Key
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gpg &lt;span class="nt"&gt;--full-generate-key&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At each prompt:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Key type: &lt;code&gt;1&lt;/code&gt; (RSA and RSA)&lt;/li&gt;
&lt;li&gt;Key size: &lt;code&gt;4096&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Expiry: &lt;code&gt;0&lt;/code&gt; (never expires)&lt;/li&gt;
&lt;li&gt;Real name: your name or handle&lt;/li&gt;
&lt;li&gt;Email: your email&lt;/li&gt;
&lt;li&gt;Comment: leave blank&lt;/li&gt;
&lt;li&gt;Passphrase: choose a strong one — you'll need it every time you sign&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Note your fingerprint:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gpg &lt;span class="nt"&gt;--list-secret-keys&lt;/span&gt; &lt;span class="nt"&gt;--keyid-format&lt;/span&gt; LONG
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The fingerprint is the long string under &lt;code&gt;pub&lt;/code&gt;, e.g. &lt;code&gt;AC5DDD2ED0068633D2223CFFD5DBABC9625AB5BE&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Add Your GPG Key to GitHub
&lt;/h3&gt;

&lt;p&gt;Export and add to GitHub so your commits show "Verified":&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gpg &lt;span class="nt"&gt;--export&lt;/span&gt; &lt;span class="nt"&gt;--armor&lt;/span&gt; your@email.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy the output and add it at: GitHub → Settings → SSH and GPG keys → New GPG key&lt;/p&gt;

&lt;p&gt;Configure git to sign commits:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.signingkey YOUR_FINGERPRINT
git config &lt;span class="nt"&gt;--global&lt;/span&gt; commit.gpgsign &lt;span class="nb"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Fork and Clone guix.sigs
&lt;/h3&gt;

&lt;p&gt;Fork &lt;code&gt;https://github.com/bitcoin-core/guix.sigs&lt;/code&gt; to your account, then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/YOUR_USERNAME/guix.sigs.git
&lt;span class="nb"&gt;cd &lt;/span&gt;guix.sigs
git remote add upstream https://github.com/bitcoin-core/guix.sigs.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. Set Up the Docker Build Environment
&lt;/h3&gt;

&lt;p&gt;Use fanquake's core-review (&lt;a href="https://github.com/fanquake/core-review" rel="noopener noreferrer"&gt;https://github.com/fanquake/core-review&lt;/a&gt;) Docker image which has Guix pre-installed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/fanquake/core-review.git
&lt;span class="nb"&gt;cd &lt;/span&gt;core-review/guix
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Build the Docker image (takes ~15 minutes, downloads Bitcoin Core source):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker build &lt;span class="nt"&gt;--pull&lt;/span&gt; &lt;span class="nt"&gt;--no-cache&lt;/span&gt; &lt;span class="nt"&gt;-t&lt;/span&gt; alpine_guix - &amp;lt; imagefile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Building and Attesting a Release
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Start the Container
&lt;/h3&gt;

&lt;p&gt;Always start with DNS specified and &lt;code&gt;--privileged&lt;/code&gt; (required for Guix sandboxing):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;-it&lt;/span&gt; &lt;span class="nt"&gt;--privileged&lt;/span&gt; &lt;span class="nt"&gt;--dns&lt;/span&gt; 8.8.8.8 &lt;span class="nt"&gt;--dns&lt;/span&gt; 8.8.4.4 &lt;span class="nt"&gt;--name&lt;/span&gt; alpine_guix_build alpine_guix bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;If the container already exists from a previous run:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker start &lt;span class="nt"&gt;-ai&lt;/span&gt; alpine_guix_build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Inside the Container — Initial Setup
&lt;/h3&gt;

&lt;p&gt;Source the Guix profile (required every session, or add to &lt;code&gt;~/.bashrc&lt;/code&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;source&lt;/span&gt; /var/guix/profiles/per-user/root/current-guix/etc/profile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add to &lt;code&gt;~/.bashrc&lt;/code&gt; so it persists:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'source /var/guix/profiles/per-user/root/current-guix/etc/profile'&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; ~/.bashrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start the Guix daemon with an extended timeout (important for slow connections):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;guix-daemon &lt;span class="nt"&gt;--build-users-group&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;guixbuild &lt;span class="nt"&gt;--timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;21600 &amp;amp;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Checkout the Release Tag
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /bitcoin
git fetch origin
git checkout v31.0   &lt;span class="c"&gt;# replace with the version you're building&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 4: (Optional) macOS SDK
&lt;/h3&gt;

&lt;p&gt;Building macOS targets requires the Xcode SDK. Without it, your attestation will have &lt;code&gt;X&lt;/code&gt; (missing) for darwin entries.&lt;/p&gt;

&lt;p&gt;To get the SDK:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Download &lt;code&gt;Xcode-26.1.1-17B100-extracted-SDK-with-libcxx-headers.tar&lt;/code&gt; (check &lt;code&gt;contrib/macdeploy/README.md&lt;/code&gt; for current version and hash)&lt;/li&gt;
&lt;li&gt;Verify the SHA256 hash against the one in the README&lt;/li&gt;
&lt;li&gt;Copy into the container and extract:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# On your host — copy into container&lt;/span&gt;
docker &lt;span class="nb"&gt;cp&lt;/span&gt; ~/Downloads/Xcode-26.1.1-17B100-extracted-SDK-with-libcxx-headers.tar alpine_guix_build:/bitcoin/depends/SDKs/

&lt;span class="c"&gt;# Inside container — verify and extract&lt;/span&gt;
&lt;span class="nb"&gt;sha256sum&lt;/span&gt; /bitcoin/depends/SDKs/Xcode-26.1.1-17B100-extracted-SDK-with-libcxx-headers.tar
&lt;span class="c"&gt;# Verify it matches README before extracting&lt;/span&gt;
&lt;span class="nb"&gt;tar &lt;/span&gt;xf /bitcoin/depends/SDKs/Xcode-26.1.1-17B100-extracted-SDK-with-libcxx-headers.tar &lt;span class="nt"&gt;-C&lt;/span&gt; /bitcoin/depends/SDKs/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 5: Start the Build
&lt;/h3&gt;

&lt;p&gt;Use tmux to protect against terminal disconnection:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;tmux new &lt;span class="nt"&gt;-s&lt;/span&gt; bitcoin-build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Set environment variables and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;SIGNER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"your_github_username"&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;VERSION&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"31.0"&lt;/span&gt;    &lt;span class="c"&gt;# without the v prefix&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;JOBS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;2            &lt;span class="c"&gt;# lower if machine has &amp;lt;16GB RAM&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;HOSTS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"x86_64-linux-gnu aarch64-linux-gnu arm-linux-gnueabihf riscv64-linux-gnu powerpc64-linux-gnu x86_64-w64-mingw32"&lt;/span&gt;
&lt;span class="c"&gt;# Add darwin targets if you have the SDK:&lt;/span&gt;
&lt;span class="c"&gt;# export HOSTS="x86_64-linux-gnu aarch64-linux-gnu arm-linux-gnueabihf riscv64-linux-gnu powerpc64-linux-gnu x86_64-w64-mingw32 x86_64-apple-darwin arm64-apple-darwin"&lt;/span&gt;

./contrib/guix/guix-build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;If your machine sleeps or terminal closes&lt;/strong&gt;, reattach:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker start &lt;span class="nt"&gt;-ai&lt;/span&gt; alpine_guix_build
tmux attach &lt;span class="nt"&gt;-t&lt;/span&gt; bitcoin-build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;If the build fails with "build directories already exist":&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./contrib/guix/guix-clean
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Expected build time:&lt;/strong&gt; 4-8 hours for all Linux + Windows platforms on an 8-core machine.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 6: Verify Build Output
&lt;/h3&gt;

&lt;p&gt;When the build finishes you'll see &lt;code&gt;-- Installing:&lt;/code&gt; lines. Verify output exists:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; /bitcoin/guix-build-31.0/output/
&lt;span class="c"&gt;# Should show: aarch64-linux-gnu  arm-linux-gnueabihf  dist-archive  powerpc64-linux-gnu  riscv64-linux-gnu  x86_64-linux-gnu  x86_64-w64-mingw32&lt;/span&gt;
&lt;span class="c"&gt;# (plus x86_64-apple-darwin and arm64-apple-darwin if you built darwin)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 7: Clone guix.sigs Inside the Container
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /
git clone https://github.com/YOUR_USERNAME/guix.sigs.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 8: Import Your GPG Key
&lt;/h3&gt;

&lt;p&gt;GPG isn't in the container by default:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;apk add gnupg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Export your key from host and copy in:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# On your HOST terminal:&lt;/span&gt;
gpg &lt;span class="nt"&gt;--export-secret-keys&lt;/span&gt; &lt;span class="nt"&gt;--armor&lt;/span&gt; your@email.com &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /tmp/mykey.gpg
docker &lt;span class="nb"&gt;cp&lt;/span&gt; /tmp/mykey.gpg alpine_guix_build:/tmp/mykey.gpg
&lt;span class="nb"&gt;rm&lt;/span&gt; /tmp/mykey.gpg  &lt;span class="c"&gt;# clean up immediately&lt;/span&gt;

&lt;span class="c"&gt;# Inside container:&lt;/span&gt;
gpg &lt;span class="nt"&gt;--import&lt;/span&gt; /tmp/mykey.gpg
&lt;span class="nb"&gt;rm&lt;/span&gt; /tmp/mykey.gpg
gpg &lt;span class="nt"&gt;--list-secret-keys&lt;/span&gt;  &lt;span class="c"&gt;# verify it imported&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 9: Generate the Attestation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /bitcoin
&lt;span class="nv"&gt;GUIX_SIGS_REPO&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/guix.sigs &lt;span class="nv"&gt;SIGNER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;YOUR_FINGERPRINT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;your_github_username ./contrib/guix/guix-attest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll be prompted for your GPG passphrase. This creates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/guix.sigs/31.0/your_username/noncodesigned.SHA256SUMS&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/guix.sigs/31.0/your_username/noncodesigned.SHA256SUMS.asc&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Verify the files look correct:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; /guix.sigs/31.0/your_username/noncodesigned.SHA256SUMS
&lt;span class="c"&gt;# Should show hashes for all platforms you built&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 10: Commit and Push
&lt;/h3&gt;

&lt;p&gt;Configure git inside the container:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /guix.sigs
git config user.email &lt;span class="s2"&gt;"your@email.com"&lt;/span&gt;
git config user.name &lt;span class="s2"&gt;"your_github_username"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a branch and commit (include your builder key on first attestation):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git checkout &lt;span class="nt"&gt;-b&lt;/span&gt; add-your_username-31.0-attestation
git add 31.0/your_username/ builder-keys/your_username.gpg
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Add attestations by your_username for 31.0 noncodesigned"&lt;/span&gt;
git push origin add-your_username-31.0-attestation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; On your first attestation, also add your GPG public key:&lt;/p&gt;


&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# On your host:&lt;/span&gt;
gpg &lt;span class="nt"&gt;--export&lt;/span&gt; &lt;span class="nt"&gt;--armor&lt;/span&gt; your@email.com &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; ~/guix.sigs/builder-keys/your_username.gpg
&lt;span class="c"&gt;# Then copy into container or commit from host&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Step 11: Open a Pull Request
&lt;/h3&gt;

&lt;p&gt;Go to &lt;code&gt;https://github.com/bitcoin-core/guix.sigs&lt;/code&gt; and open a PR from your fork.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PR title:&lt;/strong&gt; &lt;code&gt;Add attestations by your_username for 31.0 noncodesigned&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PR description:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Noncodesigned attestations for v31.0 built on [Your OS].

GPG fingerprint: YOUR_FINGERPRINT
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  What Happens After You Open the PR
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;github-actions bot&lt;/strong&gt; posts a hash matrix showing your hashes vs all other builders&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;█&lt;/code&gt; = your hash matches everyone else ✅&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;X&lt;/code&gt; = missing hash (you didn't build that platform)&lt;/li&gt;
&lt;li&gt;Any other symbol = mismatch (investigate!)&lt;/li&gt;
&lt;li&gt;A maintainer approves and merges&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Single Commit Requirement
&lt;/h3&gt;

&lt;p&gt;Maintainers require a single non-merge commit. If you have multiple commits:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# On your host&lt;/span&gt;
&lt;span class="nb"&gt;cd&lt;/span&gt; ~/guix.sigs
git fetch origin
git checkout add-your_username-31.0-attestation
git reset &lt;span class="nt"&gt;--soft&lt;/span&gt; HEAD~N   &lt;span class="c"&gt;# N = number of commits to squash&lt;/span&gt;
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Add attestations by your_username for 31.0 noncodesigned"&lt;/span&gt;
git push origin add-your_username-31.0-attestation &lt;span class="nt"&gt;--force&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Subsequent Releases
&lt;/h2&gt;

&lt;p&gt;For future releases (v31.1, v32.0 etc.), the process is faster:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Your builder key is already in the repo — no need to add it again&lt;/li&gt;
&lt;li&gt;The Docker container has all Guix cache — no re-downloading toolchains&lt;/li&gt;
&lt;li&gt;Just clean, checkout new tag, and build:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker start &lt;span class="nt"&gt;-ai&lt;/span&gt; alpine_guix_build
&lt;span class="c"&gt;# Inside container:&lt;/span&gt;
&lt;span class="nb"&gt;source&lt;/span&gt; /var/guix/profiles/per-user/root/current-guix/etc/profile
guix-daemon &lt;span class="nt"&gt;--build-users-group&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;guixbuild &lt;span class="nt"&gt;--timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;21600 &amp;amp;
&lt;span class="nb"&gt;cd&lt;/span&gt; /bitcoin
git fetch origin
git checkout v31.1
./contrib/guix/guix-clean
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;SIGNER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"your_username"&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;VERSION&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"31.1"&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;JOBS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;2
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;HOSTS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"x86_64-linux-gnu aarch64-linux-gnu arm-linux-gnueabihf riscv64-linux-gnu powerpc64-linux-gnu x86_64-w64-mingw32 x86_64-apple-darwin arm64-apple-darwin"&lt;/span&gt;
./contrib/guix/guix-build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Troubleshooting
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Error&lt;/th&gt;
&lt;th&gt;Cause&lt;/th&gt;
&lt;th&gt;Fix&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;guix-daemon: command not found&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Profile not sourced&lt;/td&gt;
&lt;td&gt;&lt;code&gt;source /var/guix/profiles/per-user/root/current-guix/etc/profile&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;clone: Operation not permitted&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Docker missing &lt;code&gt;--privileged&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Restart container with &lt;code&gt;--privileged&lt;/code&gt; flag&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Temporary failure in name resolution&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;No DNS in container&lt;/td&gt;
&lt;td&gt;Restart with &lt;code&gt;--dns 8.8.8.8 --dns 8.8.4.4&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SSL error: syscall failure&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Flaky network to codeberg.org&lt;/td&gt;
&lt;td&gt;Re-run &lt;code&gt;./contrib/guix/guix-build&lt;/code&gt; — it retries&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;substitution timed out after 3600 seconds&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Slow internet&lt;/td&gt;
&lt;td&gt;Use &lt;code&gt;--timeout=21600&lt;/code&gt; flag on guix-daemon&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Build directories already exist&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Interrupted previous build&lt;/td&gt;
&lt;td&gt;Run &lt;code&gt;./contrib/guix/guix-clean&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;macOS SDK does not exist&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Missing Xcode SDK&lt;/td&gt;
&lt;td&gt;Download SDK, verify hash, extract to &lt;code&gt;depends/SDKs/&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;OOM kill / signal 9&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Not enough RAM&lt;/td&gt;
&lt;td&gt;Set &lt;code&gt;export JOBS=2&lt;/code&gt; to limit parallelism&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;noncodesigned.SHA256SUMS already exists&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Previous partial attestation&lt;/td&gt;
&lt;td&gt;&lt;code&gt;rm /guix.sigs/VERSION/username/noncodesigned.SHA256SUMS{,.asc}&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Key Commands Reference
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Start container (first time)&lt;/span&gt;
docker run &lt;span class="nt"&gt;-it&lt;/span&gt; &lt;span class="nt"&gt;--privileged&lt;/span&gt; &lt;span class="nt"&gt;--dns&lt;/span&gt; 8.8.8.8 &lt;span class="nt"&gt;--dns&lt;/span&gt; 8.8.4.4 &lt;span class="nt"&gt;--name&lt;/span&gt; alpine_guix_build alpine_guix bash

&lt;span class="c"&gt;# Resume container&lt;/span&gt;
docker start &lt;span class="nt"&gt;-ai&lt;/span&gt; alpine_guix_build

&lt;span class="c"&gt;# Save container state (before recreating)&lt;/span&gt;
docker commit alpine_guix_build alpine_guix_cached

&lt;span class="c"&gt;# Stop container&lt;/span&gt;
docker stop alpine_guix_build

&lt;span class="c"&gt;# Source Guix profile&lt;/span&gt;
&lt;span class="nb"&gt;source&lt;/span&gt; /var/guix/profiles/per-user/root/current-guix/etc/profile

&lt;span class="c"&gt;# Start Guix daemon&lt;/span&gt;
guix-daemon &lt;span class="nt"&gt;--build-users-group&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;guixbuild &lt;span class="nt"&gt;--timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;21600 &amp;amp;

&lt;span class="c"&gt;# Run build&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;SIGNER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"username"&lt;/span&gt; &lt;span class="nv"&gt;VERSION&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"31.0"&lt;/span&gt; &lt;span class="nv"&gt;JOBS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;2
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;HOSTS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"x86_64-linux-gnu aarch64-linux-gnu arm-linux-gnueabihf riscv64-linux-gnu powerpc64-linux-gnu x86_64-w64-mingw32 x86_64-apple-darwin arm64-apple-darwin"&lt;/span&gt;
./contrib/guix/guix-build

&lt;span class="c"&gt;# Generate attestation&lt;/span&gt;
&lt;span class="nv"&gt;GUIX_SIGS_REPO&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/guix.sigs &lt;span class="nv"&gt;SIGNER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;FINGERPRINT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;username ./contrib/guix/guix-attest

&lt;span class="c"&gt;# Clean interrupted build&lt;/span&gt;
./contrib/guix/guix-clean
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/bitcoin-core/guix.sigs" rel="noopener noreferrer"&gt;guix.sigs repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bitcoin/bitcoin/blob/master/doc/release-process.md" rel="noopener noreferrer"&gt;Bitcoin Core release process&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/fanquake/core-review" rel="noopener noreferrer"&gt;fanquake/core-review&lt;/a&gt; — Docker images for building&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bitcoin/bitcoin/blob/master/contrib/macdeploy/README.md" rel="noopener noreferrer"&gt;macOS SDK extraction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/bitcoin/bitcoin/blob/master/contrib/guix/INSTALL.md" rel="noopener noreferrer"&gt;Guix installation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Written based on attesting Bitcoin Core v31.0 on Fedora Linux 43, April 2026. PR: &lt;a href="https://github.com/bitcoin-core/guix.sigs/pull/2400" rel="noopener noreferrer"&gt;bitcoin-core/guix.sigs#2400&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>bitcoin</category>
      <category>attestations</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Thinking in Java: A Beginner’s Guide to Building Your First Logic</title>
      <dc:creator>Nkatha Kaburu</dc:creator>
      <pubDate>Thu, 16 Apr 2026 08:27:00 +0000</pubDate>
      <link>https://forem.com/nkatha_kaburu/thinking-in-java-a-beginners-guide-to-building-your-first-logic-3f0a</link>
      <guid>https://forem.com/nkatha_kaburu/thinking-in-java-a-beginners-guide-to-building-your-first-logic-3f0a</guid>
      <description>&lt;p&gt;Starting with Java can feel like walking into a room full of rigid rules. But once you understand the why behind the structure, it becomes a powerful way to organize your thoughts.&lt;br&gt;
Today, let’s build&lt;/p&gt;

&lt;p&gt;a Bulk Discount Calculator. Our rule: The first 100 items are full price, but every item after that gets a 75% discount.&lt;br&gt;
Here is the mental framework I use to write Java from scratch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. The "Blueprint" Mentality (Classes)&lt;/strong&gt;&lt;br&gt;
In Java, you don't just write code; you build "blueprints." We call these &lt;strong&gt;Classes&lt;/strong&gt;.&lt;br&gt;
If you’re building a calculator, your class is the factory.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Thought Process: "I need a container for my logic. I’ll call it PriceCalculator."
*Tip: Use PascalCase for classes!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Setting the "Global Rules" (Static Variables)&lt;/strong&gt;&lt;br&gt;
Some things never change. In our case, the 100-item limit and the 75% discount are "universal truths" for our program. We use the static keyword for these.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Thought Process: "This rule applies to every calculation, not just one specific product. I'll make it static so it belongs to the Class itself."&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Creating the "Thing" (State &amp;amp; Variables)&lt;/strong&gt;&lt;br&gt;
Now, we need to handle specific data, like the product name or the quantity.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;String: For text (Name).&lt;/li&gt;
&lt;li&gt;int: For whole numbers (Quantity).&lt;/li&gt;
&lt;li&gt;BigDecimal: For money. Never use double for money! (Doubles have tiny rounding errors that steal cents over time).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  4. The "Birth" of an Object (Constructors)
&lt;/h2&gt;

&lt;p&gt;A Constructor is the "setup" phase. It’s what happens the moment you create a new product.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Thought Process: "When I create a product, I want to force the program to give it a name and a price immediately."&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5. Making it Do Something (Methods)&lt;/strong&gt;&lt;br&gt;
Methods are just functions that live inside your class.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Thought Process: "I need a behavior called calculateTotal. It should look at the quantity and decide which math rule to apply."&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;6. Talking to the User (Inputs &amp;amp; Error Handling)&lt;/strong&gt;&lt;br&gt;
Users are unpredictable. They might type "banana" when you asked for a price.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The Scanner: We use a Scanner tool to read what they type.&lt;/li&gt;
&lt;li&gt;Try-Catch: This is our safety net. We "try" to do the math, but if the user enters garbage, we "catch" the error and show a nice message instead of letting the program crash.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Final Result
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.Scanner&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.math.BigDecimal&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;DiscountApp&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Global Rules (Static)&lt;/span&gt;
    &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="no"&gt;LIMIT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="no"&gt;DISCOUNT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.75&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; 

    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;Scanner&lt;/span&gt; &lt;span class="n"&gt;sc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Scanner&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;in&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

        &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Product Name:"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
            &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;nextLine&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;

            &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Unit Price:"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
            &lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;nextDouble&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;

            &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Quantity:"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
            &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;qty&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;nextInt&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;

            &lt;span class="c1"&gt;// The Logic Process&lt;/span&gt;
            &lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;total&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;qty&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="no"&gt;LIMIT&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
                &lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;qty&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
            &lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
                &lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;fullPricePart&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;LIMIT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
                &lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;discountedPart&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;qty&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="no"&gt;LIMIT&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;price&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;0.25&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
                &lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fullPricePart&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;discountedPart&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
            &lt;span class="o"&gt;}&lt;/span&gt;

            &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Total for "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;": $"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;total&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

        &lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Oops! Please enter numbers for price and quantity."&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="k"&gt;finally&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;sc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;close&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// Cleaning up&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;What about "Death"? (Destructors)&lt;br&gt;
In languages like C++, you have to manually destroy objects to save memory. In Java, we have a "Cleaning Crew" called the Garbage Collector. It automatically deletes objects you aren't using. You don't write destructors; you just stop using the object, and Java does the dishes for you!&lt;br&gt;
Summary for your Journey:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Define the Class (The Blueprint)&lt;/li&gt;
&lt;li&gt;Set Static Variables (The Global Rules)&lt;/li&gt;
&lt;li&gt;Capture Inputs (The Raw Data)&lt;/li&gt;
&lt;li&gt;Use Try-Catch (The Safety Net)&lt;/li&gt;
&lt;li&gt;Write Methods (The Behavior)&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;/ol&gt;

</description>
      <category>java</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
