Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
•
Sicherheitslücken (CVE)USN-8821-1: OpenStack Swift vulnerability(24.09.2026 um 21:18 Uhr)
•
Sicherheitslücken (CVE)USN-8820-1: curl vulnerabilities(24.09.2026 um 22:13 Uhr)
•
Linux Tipps & HardeningDSA-6512-1 libreoffice - security update(24.09.2026 um 02:00 Uhr)
••••••••
Sicherheitslücken (CVE)USN-8821-1: OpenStack Swift vulnerability(24.09.2026 um 21:18 Uhr)
•
Sicherheitslücken (CVE)USN-8820-1: curl vulnerabilities(24.09.2026 um 22:13 Uhr)
•
Linux Tipps & HardeningDSA-6512-1 libreoffice - security update(24.09.2026 um 02:00 Uhr)
•••••••
Intelligence View
⚡ tsecurity.de Intelligence

Building a Confidential Sealed-Bid NFT Auction on Oasis Sapphire

Ever wanted to run a blockchain auction without revealing bids until the end? In this tutorial, we’ll build a sealed-bid NFT auction on Oasis Sapphire, where bids are fully encrypted, events are private, and the winner is publicly v…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Ever wanted to run a blockchain auction without revealing bids until the end?



In this tutorial, we’ll build a sealed-bid NFT auction on Oasis Sapphire, where bids are fully encrypted, events are private, and the winner is publicly verifiable, perfect for NFT drops, private DeFi auctions, or confidential governance.



We’ll cover:




  • Why Sapphire for privacy-first auctions

  • Smart contract design for sealed-bid auctions

  • Off-chain bid commitment and encryption

  • Encrypted events on Sapphire

  • React + ethers.js frontend integration

  • Testing, deployment, and advanced tips



By the end, you’ll have a production-ready privacy-preserving auction.









Part 1: Why Privacy Matters on Blockchain Auctions



Traditional Ethereum-style auctions expose bids as soon as they hit the blockchain. This causes issues like:




  • Front-running attacks: Bots see your bid and immediately outbid you

  • Loss of privacy: High-value bids are visible to competitors

  • Manipulation risk: Public bids allow strategic manipulation



Oasis Sapphire solves this by offering:




  • Confidential calldata: Input values are encrypted

  • Encrypted events: Logs can be private but verifiable

  • EVM compatibility: Solidity contracts work with minimal changes



So the result: You can build auctions where nobody knows your bid until reveal, yet the outcome is fully trustless.




┌─────────────┐        submitBid(commitment)       ┌───────────────┐
│ Bidder A │ ────────────────────────────────> │ SealedAuction│
└─────────────┘ │ (encrypted) │
┌─────────────┐ submitBid(commitment) │ │
│ Bidder B │ ────────────────────────────────> │ │
└─────────────┘ └─────┬─────────┘
│
▼
┌───────────────────────┐
│ Reveal Phase │
│ - submit value+salt │
│ - verify commitment │
│ - determine winner │
└─────────┬─────────────┘
│
▼
┌─────────────────────────┐
│ Winner + Final Price │
│ (publicly verifiable) │
└─────────────────────────┘












Part 2: Project Setup




  1. Create Hardhat Project




mkdir sapphire-nft-auction
cd sapphire-nft-auction
npm init -y
npm install --save-dev hardhat @nomiclabs/hardhat-ethers ethereum-waffle chai
npm install @oasisprotocol/sapphire-paratime







  1. Configure Hardhat for Sapphire Testnet




require("@nomiclabs/hardhat-ethers");
require("@oasisprotocol/sapphire-paratime");

module.exports = {
solidity: "0.8.20",
networks: {
sapphire_testnet: {
url: "https://testnet.sapphire.oasis.io",
chainId: 23295,
accounts: [process.env.PRIVATE_KEY], // your testnet wallet
},
},
};






Make sure you fund your testnet wallet with some ROSE test tokens (Testnet Faucet)









Part 3: Smart Contract Architecture



We’ll implement a sealed-bid auction:





  • submitBid: Accepts encrypted bid commitments


  • reveal: Checks commitments, reveals bids, determines winner


  • events: Logs encrypted bid submissions



Create contracts/SealedAuction.sol:




// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

contract SealedAuction {
struct Bid {
bytes32 commitment;
bool revealed;
}

address public owner;
address public winner;
uint256 public finalPrice;

mapping(address => Bid) public bids;

uint256 public biddingEnd;
uint256 public revealEnd;

event BidEncrypted(address indexed bidder, bytes32 encrypted);
event Revealed(address indexed bidder, uint256 value);

constructor(uint256 _biddingTime, uint256 _revealTime) {
owner = msg.sender;
biddingEnd = block.timestamp + _biddingTime;
revealEnd = biddingEnd + _revealTime;
}

function submitBid(bytes32 commitment) external {
require(block.timestamp < biddingEnd, "Bidding closed");
bids[msg.sender] = Bid({commitment: commitment, revealed: false});
emit BidEncrypted(msg.sender, commitment);
}

function reveal(uint256 value, bytes32 salt) external {
require(block.timestamp >= biddingEnd, "Reveal not started");
require(block.timestamp < revealEnd, "Reveal ended");

Bid storage b = bids[msg.sender];
require(b.commitment == keccak256(abi.encodePacked(value, salt)), "Bad reveal");
require(!b.revealed, "Already revealed");

b.revealed = true;
emit Revealed(msg.sender, value);

if (value > finalPrice) {
finalPrice = value;
winner = msg.sender;
}
}
}







Key points to keep in mind:




  • Only the hash of the bid is stored on-chain, not the bid itself.

  • Bids remain private until reveal().

  • Events can optionally be encrypted for extra confidentiality.









Part 4: Off-Chain Bid Commitment



Before submitting a bid, you generate a commitment hash off-chain:




import { ethers } from "ethers";

function createCommitment(bidValue) {
const salt = ethers.utils.hexlify(ethers.utils.randomBytes(32));
const commitment = ethers.utils.keccak256(
ethers.utils.defaultAbiCoder.encode(["uint256","bytes32"], [bidValue, salt])
);
return { commitment, salt };
}

// Example
const bid = createCommitment(500);
console.log("Commitment:", bid.commitment, "Salt:", bid.salt);







  • Salt prevents brute-force attacks on commitments

  • The commitment hash is sent on-chain using submitBid()




Bidder Client
+-----------------+
| bidValue + salt |
+--------+--------+
|
| keccak256 -> commitment
v
+-----------------+ encrypted calldata +------------------------+
| submitBid() | ------------------------> | SealedAuction Contract |
| (commitment) | | stores only commitment |
+-----------------+ | |
+-----------+------------+
|
encrypted event emitted
|
v
Off-chain listener/frontend
(decrypts if authorized)












Part 5: Submitting & Revealing Bids






await auctionContract.submitBid(commitment);

// Wait until bidding period ends
await auctionContract.reveal(bidValue, salt);






On Sapphire, you can use encrypted calldata so even miners/validators don’t see the bid during submission.









Part 6: Adding NFT Rewards



Let’s take it a step further: the winner receives an NFT. Add this to your contract:




interface IERC721 {
function safeMint(address to) external;
}

IERC721 public rewardNFT;

constructor(address _nft) {
owner = msg.sender;
rewardNFT = IERC721(_nft);
}

// After reveal ends
function distributeNFT() external {
require(block.timestamp >= revealEnd, "Reveal not ended");
require(winner != address(0), "No winner yet");
rewardNFT.safeMint(winner);
}












Part 7: Encrypted Events on Sapphire (Advanced)






event EncryptedBid(address indexed bidder, bytes32 encryptedData);

bytes memory ciphertext = Sapphire.encrypt(abi.encodePacked(bidValue, salt));
emit EncryptedBid(msg.sender, ciphertext);







  • Only the bidder can decrypt the event off-chain

  • Useful for building off-chain bid monitoring tools without revealing bids publicly









Part 8: Frontend Integration (React + ethers.js)




  • Generate bid commitment in React form

  • Call submitBid(commitment) on click

  • Reveal after auction ends

  • Optional: use encrypted events to show notifications without revealing bid amounts




const bid = createCommitment(inputValue);
await auctionContract.submitBid(bid.commitment);







  • Add a timer for bidding and reveal periods

  • Use ethers.js and MetaMask for transactions









Part 9: Hardhat Testing






const { expect } = require("chai");

describe("SealedAuction", function () {
it("accepts bids and picks winner correctly", async function () {
const [a, b] = await ethers.getSigners();
const Auction = await ethers.getContractFactory("SealedAuction");
const auction = await Auction.deploy(60, 120);

const bidA = ethers.utils.id("1001salt");
const bidB = ethers.utils.id("2002salt2");

await auction.submitBid(bidA);
await auction.submitBid(bidB);

await network.provider.send("evm_increaseTime", [70]);

await auction.reveal(1001, ethers.utils.formatBytes32String("salt"));
await auction.reveal(2002, ethers.utils.formatBytes32String("salt2"));

expect(await auction.winner()).to.equal(b.address);
expect(await auction.finalPrice()).to.equal(2002);
});
});












Part 10: Deploying to Sapphire Testnet






npx hardhat run scripts/deploy.js --network sapphire_testnet







Deploy script:




async function main() {
const Auction = await ethers.getContractFactory("SealedAuction");
const auction = await Auction.deploy(300, 300);
await auction.deployed();
console.log("Auction deployed at", auction.address);
}
main();












Part 11: Next-Level Ideas you could implement




  • Build a full frontend auction dApp

  • Integrate off-chain listeners for encrypted events

  • Add ZK proofs for bid fairness without revealing bids

  • Support multi-item auctions or batch NFT rewards



You now have a fully functional, privacy-preserving NFT auction on Oasis Sapphire. Bids are private, events can be private, and the winner is verifiable. Perfect for real-world confidential DeFi and NFT applications!

CTI Threat Relationship Graph2 Knoten / 1 Relationen
CVE / Incident Software MITRE ATT&CK CWE Weakness IoC
SOC Incident Playbook: Remote Code Execution (RCE) Defense
Syntax validiert (0 Fehler)
title: Detect Exploitation - Building a Confidential Sealed-Bid NFT Auction on Oasis Sapphire
id: 68a74867-ab3e-4ca4-abd6-6fdb240efa79
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-24
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
Syntax validiert (0 Fehler)
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-24"
        description = "YARA Signature for "
    strings:
        $str = "Building a Confidential Sealed" ascii wide
    condition:
        any of them
}
Syntax validiert (0 Fehler)
index=security sourcetype IN ("cisco:asa", "pan:traffic", "zeek_conn", "suricata", "WinEventLog:Security")
("Building a Confidential Sealed-Bid NFT A")
| stats count earliest(_time) as first_seen latest(_time) as last_seen by src_ip, dest_ip, dest_host, signature
| eval first_seen=strftime(first_seen, "%Y-%m-%d %H:%M:%S"), last_seen=strftime(last_seen, "%Y-%m-%d %H:%M:%S")
| sort - count
Syntax validiert (0 Fehler)
message: "*Building a Confidential Sealed-Bid NFT A*"
Syntax validiert (0 Fehler)
CommonSecurityLog
| where Message has "Building a Confidential Sealed-Bid NFT A"
| summarize EventCount = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by SourceIP, DestinationIP, DestinationPort, Activity
| extend DetectionRule = "iShareStuff-CTI-Compiled"
| sort by EventCount desc
🎯
MITRE ATT&CK Matrix Navigator 14 Taktiken
Reconnaissance
-
Resource Development
-
Initial Access
Execution
Persistence
-
Privilege Escalation
Defense Evasion
Credential Access
-
Discovery
-
Lateral Movement
-
Collection
-
Command and Control
Exfiltration
-
Impact
tsecurity.de Cognitive Threat RAG
Fokus-Vektor:

Kognitive Analyse für identifizierte Bedrohung: Erhöhte Bedrohungslage im Bereich Building a Confidential Sealed-Bid NFT A.... Basierend auf 368k Vektor-Korrelationen werden sofortige Isolationsmaßnahmen für betroffene Endpunkte empfohlen.

🛡️ Angriffsfläche & Exposure

Netzwerk/Remote-Zugriff ohne Vorauthentifizierung möglich.

⚡ Empfohlene Sofortmaßnahmen
  • 1. Perimeter-Inspektion: Relevante Portfreigaben und exponierte Endpunkte unverzüglich scannen.
  • 2. Patch-Applikation: Hersteller-Hotfix einspielen oder betroffene Daemons in isolierte DMZ-Segmente überführen.
  • 3. Telemetrie & EDR-Alerts: Prozessaufrufe und Child-Processes auf anomale Shell-Spawns überwachen.
🔗 Semantisch verwandte Zero-Days MariaDB 11.7 VEC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Building a Confidential Sealed-Bid NFT Auction on Oasis Sapphire

Thematisch verwandte Begriffe: Building, Confidential, SealedBid, Auction · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-81473 | Dell Rugged Control Center (RCC), versions prior to 5.2.206, contain an …
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel • Rechts: nächster Artikel • unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel TTP ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...
↗ Original-Quelle