Close Menu
  • News
    • Bitcoin
    • Altcoins
    • DeFi
    • Regulation
    • Market Cap
    • Web 3
    • Scam
  • Blockchain
  • NFT
  • Metaverse
  • Analysis
  • Learn
  • Blog
  • Contact
    • Tech7685@gmail.com
What's Hot

British Museum puts sculptures from Dürer’s ‘Rhinoceros’ on Bitcoin Blockchain

2025-05-14

The Shibuya streaming platform from PPLEPPLEASR is back with 5 epic short films

2025-05-14

Bitcoin can hit $ 135k in 100 days, says analyst who looks at Vix Drop

2025-05-14
Facebook X (Twitter) Instagram
  • Contact
  • Terms & Conditions
  • Privacy Policy
  • DMCA
  • Advertise
  • BitcoinPlatform.com
Facebook X (Twitter) Instagram
Free Cryptocurrency – Bitcoin | Altcoins | Blockchain | News Stories Updated Daily
  • News
    • Bitcoin
    • Altcoins
    • DeFi
    • Regulation
    • Market Cap
    • Web 3
    • Scam
  • Blockchain

    SyntternNet Partners with Hive Intelligence to transfer AI agents to the chains in 60+ block chains

    2025-05-14

    Co-founder of Solana Anatoly proposes a Metablokchain concept

    2025-05-14

    Layer-2 Blockchain explosion ends safe integration on the risks of third parties risks

    2025-05-14

    Codexfield bundles forces with LoveBit to stimulate ESG Innovation in Web3 & Crypto

    2025-05-14

    SFT protocol joins Glacier Labs to bridge physical and data infrastructure

    2025-05-14
  • NFT

    British Museum puts sculptures from Dürer’s ‘Rhinoceros’ on Bitcoin Blockchain

    2025-05-14

    The Shibuya streaming platform from PPLEPPLEASR is back with 5 epic short films

    2025-05-14

    AI Sports Betting Agent wants to disrupt the Tipster industry using Crypto

    2025-05-14

    Bidding starts at Ross Ulbricht’s pre-judgment and prison thinking of the fact that he is starting a new chapter

    2025-05-14

    Why this Facebook group places the news on NFTS

    2025-05-13
  • Metaverse

    Shib: The Metaverse – Part of the expanding Shiba Inu ecosystem

    2025-01-03

    Experience to Earn: Everdome’s Metaverse Frontier

    2024-12-30

    Beyond Bots: Meta Motivo and the Dawn of Human Digital Life

    2024-12-13

    Exploring NetVRk: What’s Behind This AI-Powered Virtual Universe?

    2024-10-28

    Council of Europe emphasizes the impact of Metaverse on privacy and democracy

    2024-09-05
  • Analysis

    $ 36 is in the cards as a period of 3 months becomes bullish?

    2025-05-14

    Low Cap Nasdaq-Gentered Company reveals $ 300,000,000 fundraising plan to acquire crypto, including the Trump token of the president: report

    2025-05-14

    Why $ 2.69 contains the key

    2025-05-14

    According to analyst Jason Pizzino, it will be time to be careful to carefully turn to cryptomarkets

    2025-05-14

    Dogecoin (Doge) is higher for the next leg – will the resistance plan break?

    2025-05-14
  • Learn

    What Is Proof-of-Work (PoW)?

    2025-05-12

    What Is Proof-of-Authority (PoA)?

    2025-05-10

    What Is Proof-of-Stake (PoS)? A Beginner’s Guide

    2025-05-09

    What Is a Layer-1 (L1) Blockchain?

    2025-05-03

    What is a Layer-2 (L2) Blockchain Network Solution?

    2025-05-02
  • Blog
  • Contact
    • Tech7685@gmail.com
Free Cryptocurrency – Bitcoin | Altcoins | Blockchain | News Stories Updated Daily
Home»Blockchain»Safegcd implementation formally verified
Blockchain

Safegcd implementation formally verified

2024-11-27No Comments5 Mins Read
Share
Facebook Twitter LinkedIn Pinterest Email

Introduction

The security of Bitcoin and other blockchains, such as Liquid, depends on the use of digital signature algorithms such as ECDSA and Schnorr signatures. The AC library called libsecp256k1, named after the elliptic curve on which the library operates, is used by both Bitcoin Core and Liquid to provide these digital signature algorithms. These algorithms use a mathematical calculation called a modular invertedwhich is a relatively expensive part of the calculation.

In “Fast constant-time gcd computation and modular inversion”, Daniel J. Bernstein and Bo-Yin Yang develop a new modular inversion algorithm. In 2021, this algorithm, also called ‘safegcd’, was implemented for libsecp256k1 by Peter Dettman. As part of the vetting process for this new algorithm, Blockstream Research was the first to complete a formal verification of the algorithm’s design by using the Coq proof assistant to formally verify that the algorithm indeed ends with the correct modular inverse result at 256 -bit inputs.

The gap between algorithm and implementation

The formalization efforts in 2021 have only shown that the algorithm designed by Bernstein and Yang works correctly. However, using that algorithm in libsecp256k1 requires implementing the mathematical description of the safegcd algorithm in the C programming language. For example, the mathematical description of the algorithm performs matrix multiplication of vectors that can be as wide as signed integers of 256 bits , but the C programming language only provides integers up to 64 bits (or 128 bits with some language extensions).

Implementing the safegcd algorithm requires programming the matrix multiplication and other calculations using C’s 64-bit integers. In addition, many other optimizations have been added to make the implementation fast. Ultimately, there are four separate implementations of the safegcd algorithm in libsecp256k1: two constant-time signature generation algorithms, one optimized for 32-bit systems and one optimized for 64-bit systems, and two variable-time signature verification algorithms, again one for 32 -bit systems and one for 64-bit systems.

See also  LayerZero's wstETH bridge implementation draws Lido DAO ire

Verifiable C

To verify that the C code correctly implements the safegcd algorithm, all implementation details must be checked. We use Verifiable C, part of the Verified Software Toolchain, to reason about C code using the Coq theorem prover.

Verification is accomplished by specifying pre- and post-conditions using separation logic for each function undergoing verification. Separation logic is a logic that specializes in reasoning about subroutines, memory allocations, concurrency, and more.

Once each function has been given a specification, verification continues by starting from a function’s precondition and establishing a new invariant after each statement in the function’s body, until finally establishing the postcondition at the end of the function. function text or at the end of each function. statement back. Most of the formalization effort is spent “between” the lines of code, using the invariants to translate the raw operations of each C expression into higher-level statements about what the data structures being manipulated mathematically represent. For example, what the C language considers an array of 64-bit integers may actually be a representation of a 256-bit integer.

The end result is a formal proof, verified by the Coq proof assistant, that libsecp256k1’s 64-bit variable time implementation of the safegcd modular inverse algorithm is functionally correct.

Limitations of authentication

There are some limitations to the proof of functional correctness. The separation logic used in Verifiable C implements what is known as partial correctness. That means it only proves that the C code returns with the correct result as it returns, but it does not prove the termination itself. We mitigate this limitation by using our previous Coq proof of the limits of the safegcd algorithm to prove that the loop counter value of the main loop is in fact never greater than 11 iterations.

See also  Wat zijn gedecentraliseerde fysieke infrastructuurnetwerken (DePIN)?

Another problem is that the C language itself has no formal specification. Instead, the Verifiable C project uses the CompCert compiler project to provide a formal specification of a C language. This guarantees that when a verified C program is compiled with the CompCert compiler, the resulting assembly code will conform to the specification (subject to the above restriction). However, this does not guarantee that the code generated by GCC, clang or any other compiler will necessarily work. For example, C compilers are allowed to have different evaluation orders for arguments within a function call. And even if the C language had a formal specification, any compiler that hasn’t been formally verified itself could still compile programs incorrectly. This does happen in practice.

Finally, Verifiable C does not support passing structures, returning structures, or assigning structures. While in libsecp256k1 structures are always passed via a pointer (which is allowed in Verifiable C), there are a few cases where structure allocation is used. For the modular inverse correctness proof, there were 3 commands that had to be replaced by a specialized function call that performs the structure assignment field by field.

Summary

Blockstream Research has formally verified the correctness of libsecp256k1’s modular inverse function. This work provides further evidence that verification of C code is possible in practice. Using a general-purpose proofing assistant, we can verify software built on complex mathematical arguments.

Nothing prevents the rest of the functions implemented in libsecp256k1 from also being verified. Thus, it is possible for libsecp256k1 to obtain the highest possible guarantees of software correctness.

This is a guest post by Russell O’Connor and Andrew Poelstra. The opinions expressed are entirely their own and do not necessarily reflect those of BTC Inc or Bitcoin Magazine.

See also  Blockchain startup BTQ proposes more energy-efficient alternative for Cryptos Proof of Work

Source link

formally Implementation Safegcd verified
Share. Facebook Twitter Pinterest LinkedIn Tumblr Email

Related Posts

SyntternNet Partners with Hive Intelligence to transfer AI agents to the chains in 60+ block chains

2025-05-14

Co-founder of Solana Anatoly proposes a Metablokchain concept

2025-05-14

Layer-2 Blockchain explosion ends safe integration on the risks of third parties risks

2025-05-14

Codexfield bundles forces with LoveBit to stimulate ESG Innovation in Web3 & Crypto

2025-05-14
Add A Comment

Comments are closed.

Top Posts

Bitgert to redefine Web3 solutions in collaboration with FNS

2025-02-10

Bitcoin Rally to $75,000 Predicted by Cup and Handle Breakout

2024-02-15

BOOK OF MEME (BOME) Price Prediction 2024 2025 2026 2027

2025-01-04
Editors Picks

Coinbase protects the re-entry to the Indian crypto market with FIU approval

2025-03-11

XRP -Rij test critical barrier: will bulls lose bulls?

2025-02-05

-79% since the start of the year

2023-08-12

$15,000,000,000,000 Floodgates Open for Bitcoin After BTC Exchange-Traded Fund Approval: Glassnode Founders

2023-10-29
About
About

Our mission is to develop a community of people who try to make financially sound decisions. The website strives to educate individuals in making wise choices about Cryptocurrencies, Defi, NFT, Metaverse and more.

We're social. Connect with us:

Facebook X (Twitter) Instagram Pinterest YouTube
Top Insights

British Museum puts sculptures from Dürer’s ‘Rhinoceros’ on Bitcoin Blockchain

The Shibuya streaming platform from PPLEPPLEASR is back with 5 epic short films

Bitcoin can hit $ 135k in 100 days, says analyst who looks at Vix Drop

Get Informed

Subscribe to Updates

Get the latest news and Update from Free.cc about Crypto, Metaverse, NFT and more.

  • Contact
  • Terms & Conditions
  • Privacy Policy
  • DMCA
  • Advertise
  • BitcoinPlatform.com
© 2025 Free.cc - All rights reserved. Contact: info@free.cc

Type above and press Enter to search. Press Esc to cancel.

  • bitcoinBitcoin(BTC)$103,542.49-0.47%
  • ethereumEthereum(ETH)$2,608.32-2.69%
  • tetherTether USDt(USDT)$1.000.01%
  • rippleXRP(XRP)$2.56-0.84%
  • solanaSolana(SOL)$177.33-3.23%
  • binancecoinBNB(BNB)$653.46-1.57%
  • usd-coinUSDC(USDC)$1.000.00%
  • dogecoinDogecoin(DOGE)$0.233304-2.73%
  • cardanoCardano(ADA)$0.80-3.52%
  • tronTRON(TRX)$0.2746061.50%
  • suiSui(SUI)$3.94-3.05%
  • chainlinkChainlink(LINK)$17.03-2.04%
  • avalanche-2Avalanche(AVAX)$24.90-3.53%
  • stellarStellar(XLM)$0.304127-3.07%
  • shiba-inuShiba Inu(SHIB)$0.000016-3.33%
  • hedera-hashgraphHedera(HBAR)$0.206207-4.55%
  • hyperliquidHyperliquid(HYPE)$25.25-2.10%
  • unus-sed-leoUNUS SED LEO(LEO)$8.892.11%
  • the-open-networkToncoin(TON)$3.25-4.49%
  • bitcoin-cashBitcoin Cash(BCH)$402.75-2.11%
  • polkadotPolkadot(DOT)$4.98-4.21%
  • litecoinLitecoin(LTC)$100.83-2.30%
  • piPi(PI)$0.92-27.02%
  • moneroMonero(XMR)$341.42-0.17%
  • pepePepe(PEPE)$0.000014-2.68%
  • bitget-tokenBitget Token(BGB)$4.77-1.26%
  • daiDai(DAI)$1.00-0.01%
  • ethena-usdeEthena USDe(USDE)$1.000.00%
  • uniswapUniswap(UNI)$6.63-6.43%
  • bittensorBittensor(TAO)$456.13-1.00%
  • nearNEAR Protocol(NEAR)$3.05-4.78%
  • aptosAptos(APT)$5.75-6.51%
  • aaveAave(AAVE)$229.78-2.67%
  • okbOKB(OKB)$54.500.06%
  • ondo-financeOndo(ONDO)$1.01-3.19%
  • kaspaKaspa(KAS)$0.120678-3.08%
  • ethereum-classicEthereum Classic(ETC)$19.89-3.81%
  • internet-computerInternet Computer(ICP)$5.64-4.42%
  • crypto-com-chainCronos(CRO)$0.101391-1.89%
  • official-trumpOFFICIAL TRUMP(TRUMP)$13.41-2.26%
  • gatechain-tokenGateToken(GT)$21.74-0.71%
  • render-tokenRender(RENDER)$5.10-3.87%
  • mantleMantle(MNT)$0.78-3.99%
  • vechainVeChain(VET)$0.030334-4.96%
  • polygon-ecosystem-tokenPOL (prev. MATIC)(POL)$0.249205-4.13%
  • ethenaEthena(ENA)$0.409616-9.27%
  • usd1World Liberty Financial USD(USD1)$1.00-0.10%
  • algorandAlgorand(ALGO)$0.236717-4.28%
  • arbitrumArbitrum(ARB)$0.427796-5.94%
  • filecoinFilecoin(FIL)$3.05-5.07%
  • bitcoinBitcoin(BTC)$103,542.49-0.47%
  • ethereumEthereum(ETH)$2,608.32-2.69%
  • tetherTether USDt(USDT)$1.000.01%
  • rippleXRP(XRP)$2.56-0.84%
  • solanaSolana(SOL)$177.33-3.23%
  • binancecoinBNB(BNB)$653.46-1.57%
  • usd-coinUSDC(USDC)$1.000.00%
  • dogecoinDogecoin(DOGE)$0.233304-2.73%
  • cardanoCardano(ADA)$0.80-3.52%
  • tronTRON(TRX)$0.2746061.50%
  • suiSui(SUI)$3.94-3.05%
  • chainlinkChainlink(LINK)$17.03-2.04%
  • avalanche-2Avalanche(AVAX)$24.90-3.53%
  • stellarStellar(XLM)$0.304127-3.07%
  • shiba-inuShiba Inu(SHIB)$0.000016-3.33%
  • hedera-hashgraphHedera(HBAR)$0.206207-4.55%
  • hyperliquidHyperliquid(HYPE)$25.25-2.10%
  • unus-sed-leoUNUS SED LEO(LEO)$8.892.11%
  • the-open-networkToncoin(TON)$3.25-4.49%
  • bitcoin-cashBitcoin Cash(BCH)$402.75-2.11%
  • polkadotPolkadot(DOT)$4.98-4.21%
  • litecoinLitecoin(LTC)$100.83-2.30%
  • piPi(PI)$0.92-27.02%
  • moneroMonero(XMR)$341.42-0.17%
  • pepePepe(PEPE)$0.000014-2.68%
  • bitget-tokenBitget Token(BGB)$4.77-1.26%
  • daiDai(DAI)$1.00-0.01%
  • ethena-usdeEthena USDe(USDE)$1.000.00%
  • uniswapUniswap(UNI)$6.63-6.43%
  • bittensorBittensor(TAO)$456.13-1.00%
  • nearNEAR Protocol(NEAR)$3.05-4.78%
  • aptosAptos(APT)$5.75-6.51%
  • aaveAave(AAVE)$229.78-2.67%
  • okbOKB(OKB)$54.500.06%
  • ondo-financeOndo(ONDO)$1.01-3.19%
  • kaspaKaspa(KAS)$0.120678-3.08%
  • ethereum-classicEthereum Classic(ETC)$19.89-3.81%
  • internet-computerInternet Computer(ICP)$5.64-4.42%
  • crypto-com-chainCronos(CRO)$0.101391-1.89%
  • official-trumpOFFICIAL TRUMP(TRUMP)$13.41-2.26%
  • gatechain-tokenGateToken(GT)$21.74-0.71%
  • render-tokenRender(RENDER)$5.10-3.87%
  • mantleMantle(MNT)$0.78-3.99%
  • vechainVeChain(VET)$0.030334-4.96%
  • polygon-ecosystem-tokenPOL (prev. MATIC)(POL)$0.249205-4.13%
  • ethenaEthena(ENA)$0.409616-9.27%
  • usd1World Liberty Financial USD(USD1)$1.00-0.10%
  • algorandAlgorand(ALGO)$0.236717-4.28%
  • arbitrumArbitrum(ARB)$0.427796-5.94%
  • filecoinFilecoin(FIL)$3.05-5.07%