Podcast about DevSecOps

#40 - Web3 and its implications for DevSecOps practitioners

Web3 adds blockchain access and valuable private keys to familiar infrastructure problems.

18 min read

web3 has gotten a lot of attention lately; thus, it is time for us to separate facts from the hype. In this episode, we are trying to understand its implications for us as DevSecOps practitioners.

Discuss the episode or ask us anything on LinkedIn


What web3 actually changes in your stack

Venture money went into crypto companies, and the hiring followed. They need people who can run infrastructure, and the job ads reach you whether or not you care about the coins. So it’s worth knowing what’s genuinely different about the work before you take one, or before a customer asks you to put a chain under their product. The short answer: a web3 application is a web2 application with one data source you read through somebody else’s node, and one class of secret whose rotation is a transaction rather than a config change.

The pitch is generational. Web1 was static, you read it. Web2 let you upload, and the platform decides what happens next: where the file lives, who sees it, whether the account survives, whether you can take any of it with you. Ownership on paper was never the sticking point. Facebook’s own privacy principles, published in January 2018, say “You own the information you share on Facebook”. Control and portability are what people mean when they say the platform owns their photos. Web3 claims something stronger, because the record lives on a ledger nobody can quietly edit. From the operator’s seat it arrives as every web2 problem you already have, plus a blockchain.

Writing the standard was never the hard part. Making one stick is. PCI DSS exists because companies kept losing card numbers, and the card brands, not a government, founded the PCI Security Standards Council in 2006 to attach a minimum to handling one. Take a card and that minimum attaches to you. On the crypto side, C4 and BitGo published the CryptoCurrency Security Standard as a draft in February 2015, designed “to complement existing standards (ISO 27001, PCI, etc.), and not replace them”. Publication gives you a yardstick, not an obligation; whether the custodian in your design has to meet CCSS is a question for the counterparty. “We have a blockchain, it’s immutable, what could go wrong” is doing a lot of work in that sentence, while pump-and-dump schemes run in public and the people losing money have nobody to complain to.

The building blocks are already in your stack

Before the architecture, the parts. Less exotic than the vocabulary around them.

Is any of this new technology?

Mostly not. A hash function, a chain of hashes, a consensus protocol and a public key pair are things you already operate.

Start with the hash. Feed it content, get back a short string specific to that content; you cannot run it backwards. Think of a shoe print in gravel: from the print you cannot make the shoe, but the same shoe leaves the same print every time, so anyone can check. Gather transactions into a block, hash the block, put that hash into the next block, and an edit to old history changes every hash after it.

What that buys is tamper evidence, weaker than immutable. Hashes make an edit visible to anyone who re-runs them, they do not prevent one. Rewrite resistance comes from the consensus rule on top: the Bitcoin paper has nodes treat the longest chain as the record, so changing an old block means redoing its proof of work, and every later block’s, faster than the rest of the network extends the chain. That holds while most of the mining power is honest. Get hold of half of it and the same rule works for you.

If the hash part sounds familiar, it’s because you ran it this morning. A Git commit id is a hash, each commit names its parents, and rewriting history changes every id downstream, which is how Git notices damage. Git was created in April 2005, three years before the Bitcoin paper of October 2008. We like the joke that Satoshi is Linus Torvalds. It is a joke.

The rest lines up the same way. Agreeing on one version of the truth across machines that can disagree is consensus, and Kubernetes keeps its cluster state in etcd, which commits changes through the raft protocol. If it is not etcd, it is Consul or ZooKeeper. A key pair proving who you are is what your SSH config does.

The assembly is where the interesting part sits. Ethereum lets you send a transaction to an account that holds executable code as well as a balance, written in a language called Solidity, and the code runs as part of the transaction. Cutting a middleman out of a settlement is a real idea. The cost is latency: Bitcoin retargets difficulty so that blocks arrive about every ten minutes. Ethereum is faster, and neither is fast enough for someone standing at a shop counter.

You read the chain through somebody else’s node

Immutability is the property that gets advertised. The one that shapes your architecture is where your reads come from.

Where does a web3 application actually read its data from?

From a node, and that node is usually not yours. An Ethereum node keeps current account state, so a balance is one eth_getBalance call over JSON-RPC, no chain scan and no index.

History is what a node will not answer cheaply: every transfer an address has been in, every holder of a token, anything you aggregate across years of blocks. That gets extracted, processed and indexed into something answering in milliseconds, in Elasticsearch or similar, and some of the web3 work on offer is that pipeline, as far as we could tell. Otherwise the architecture is the one you already have, with chain access and that index beside your SQL or NoSQL store.

The dependency is the uncomfortable part. A phone or a browser tab makes a poor peer, so the typical application calls a hosted provider, and Infura sells exactly that: an API endpoint, priced per call. Signal co-founder Moxie Marlinspike wrote up what he found when he built on it in January 2022: almost all decentralised apps, dApps, reach the chain through one of two companies, the responses aren’t signed or verified, and the client trusts them. “People don’t want to run their own servers, and never will.”

Marlinspike is right about the economics too. A node costs electricity, storage and bandwidth to keep up with the gossip, though it is no miner: the headline figures, such as the 13.39 GW load estimate published for the Bitcoin network as of August 2021, are mining.

How far you can trust what the provider answers

That dependency behaves like any other vendor in the hot path, until you ask what happens when the provider answers wrongly rather than not at all.

Can you check what a node provider tells you?

Sometimes, and not by default. An ordinary eth_getBalance reply carries no signature and no proof, so your client takes the number on trust.

Keep the two failure modes apart. A provider that times out or answers 503 tells you something is wrong, and a second provider behind a switch covers it. The one that arrives well formed and wrong trips no alarm. Comparison is the obvious reflex, and it is weaker than it looks. Ask two nodes for a balance at latest and each answers about whatever block it currently believes, so a reorg between the calls leaves both answers honest. EIP-1898, from April 2019, lets those methods take a block hash instead, so a read names its block “even if the block is not in the canonical chain”.

Pin both reads to the same hash and a mismatch means one of the two is wrong without saying which: grounds to investigate, not a verdict on a provider. Verifying is stronger: EIP-1186, created in June 2018, adds an eth_getProof call returning a Merkle proof that, “combined with a stateRoot (from the blockheader)”, supports “offline verification of any account or storage-value”. You still need a block header you believe, from your own light client or a source you have decided to trust.

What those million-dollar JPEGs put on the chain

The same indirection runs through the product everyone noticed.

If you buy one of those NFT artworks, what do you own?

The token. The chain records you as its holder, its metadata references an asset, and rights in it come from the terms of sale.

The standard is more permissive than the practice. ERC-721 says “The metadata extension is OPTIONAL for ERC-721 smart contracts”, so a token need not carry a link. Art projects use it anyway: tokenURI returns a URI, usually a JSON file with an image field, and the rationale says it “MAY be mutable”. Nothing requires a hash commitment to what sits there, so the link pins nothing. Marlinspike’s own NFT showed a different image depending on who looked at it; when the marketplace removed it, it vanished from his wallet, which reads that API.

Rights predate the chain and are not settled by it. In the United States, 17 U.S.C. § 202 says transferring an object “does not of itself convey any rights in the copyrighted work”, and a token is not even the object. What a holder may do with the picture comes from the terms of sale, so that text belongs in your data model.

A ledger of who holds what is worth wanting for a birth certificate, a degree or a rare game item, and chip ID cards already prove holdership with the same key pairs, which says who holds the key, not what they own.

Stronger versions were in use, and OpenSea’s June 2021 write-up describes two. CryptoPunks served its images from a server, but “the smart contract stores the hash of this image”, so an altered copy could be caught. Larva Labs later put the images and attributes on chain in August 2021, which drops the host entirely.

The other mechanism is frozen metadata, pinned to an IPFS address derived from the bytes, so swapping the file changes the address. Two things have to hold first. The tokenURI must be unrepointable, since a mutable one takes a content address as easily as a URL. And the frozen file is the JSON, not the artwork: the ERC-721 metadata schema gives image as “A URI pointing to a resource with mime type image/*”, so pinning the JSON leaves the bytes behind an ordinary https:// image link free to change. Commit at every hop, token to metadata to image, or you have frozen the paperwork and left the picture on a web server that might be gone in five years.

Taking coins is easy, holding keys is not

Ownership aside, most teams meet crypto through a simpler question: somebody wants to pay you in it.

Is accepting crypto less work than integrating a payment provider?

For receiving the funds, yes, by a wide margin. Put an address on the page, derived from your public key, and the sender’s software does the rest. There is no iframe to embed and no provider contract, and no card number enters your systems that way, so that path brings no PCI DSS scope of its own. Any card flow you keep alongside it still does, and outsourcing it does not hand off the obligation: the Council’s e-commerce guidance says such a merchant “is still responsible to ensure that PCI DSS is adhered to”.

Receiving the money is the easy part of taking payment, though. The rest of what a provider absorbed is yours to write, and the Bitcoin payment-processing guide lists it. Price the order in a currency that moves against the one you invoice in. Issue a unique address per payment, so you can match payments to orders. Decide how many confirmations you wait for before you fulfil. Six is that guide’s suggested minimum for a high-value payment, about an hour at one block every ten minutes.

Spend the saving carefully, because it does not survive the next step. The receiving side holds no secret: an address is derived from a public key, and publishing it is the whole point. Authorising a spend is what the private key does, so the system holding one is a custodian, and that is not the system serving your checkout page. Keep them apart. A payment frontend needs addresses and nothing else, while signing can sit behind it on a machine that is not internet-facing. Keys that can move money are the asset, and attackers go straight at them. North Korean actors conducted at least seven attacks on cryptocurrency platforms in 2021 that stole nearly $400 million, Chainalysis found, with phishing, malware and social engineering used to reach internet-connected hot wallets.

Irreversible, traceable, and nobody to call

Custody also changes what an incident looks like, because the settlement cannot be undone.

If there is no chargeback, is the money simply gone?

Gone from your side, yes. There is no helpline, no dispute form and no reversal, which is why so much effort goes into tricking people into signing a transaction rather than into breaking the cryptography.

This is where we don’t agree. Julien’s position is that once the transaction clears you’re done, and that the absence of recourse is the thing newcomers understand last. Andrey’s is that the money stays followable in a way cash never is: every transfer is public, and after large exchange thefts, tokens have been marked and refused, which leaves the thief holding balances nobody will convert. Mixers exist to break that trail by splitting funds across many small transfers, which makes tracing harder rather than impossible.

Identity is the other end of the trace. In the United States, exchanges operate under money services business rules, and FinCEN’s 2019 guidance sets out how money transmission rules apply to business models involving convertible virtual currency, which is where know-your-customer checks come from. One case we came across ran along that seam: a seller of stolen data took payment in Bitcoin at an address belonging to his account at a US exchange, and the buyer turned out to be a security company. The ledger showed which address was paid, the exchange knew whose account it was, and the rest was paperwork.

Not your keys: what an exchange balance is

Tracing helps investigators after the fact. It does nothing about another way people lose money: an exchange loses or misuses their funds.

What are you actually holding when coins sit on an exchange?

A number in that company’s database, plus whatever claim its terms and its regulator give you. The exchange holds the private keys, and not every jurisdiction requires it to hand them over.

Money in a bank is also a number in a database, so that part is no insult. The difference is what sits around the number, and how much of it there is depends on where the company is licensed. Deposit protection and a banking regulator are jurisdiction-specific, and so is anything comparable for crypto. New York has asked for some of it since rules adopted in June 2015: section 200.9, “Custody and protection of customer assets”, makes a licensee hold virtual currency in the same type and amount as it owes customers, and leave those assets unencumbered. Plenty of venues your users reach are covered by nothing of the sort, so find out which yours is.

The January 2022 incident at crypto.com is the useful version, because the company published what happened. Its own report says 483 users were affected, with unauthorised withdrawals of 4,836.26 ETH, 443.93 BTC and about $66,200 in other tokens, approved “without the 2FA authentication control being inputted by the user”. Withdrawals were suspended for about 14 hours, and every customer 2FA token was revoked, so everyone had to enrol again. Where a withdrawal was not prevented, the report says “customers were fully reimbursed”. That is what the company says it did, not what it was obliged to do.

Put the key where your other keys live

So the new asset on your estate is a private key, and the problem it creates is one your industry has worked on for decades.

What does a signing key need that a wallet app does not give it?

The controls you already apply to every other key: controlled generation, auditable storage, access granted to roles rather than people, and a record of what signed what.

Much of the confusion is vocabulary. “Wallet” names a program, not a secret, and the two get collapsed. The Bitcoin developer guide splits a wallet system into three separable parts: a public key distribution program, a signing program and a networked program. Deployments mix them. A watching-only wallet holds no private key and still shows balances, while the signing program runs offline and hands back signed transactions. So the word tells you little on its own. What you protect is the signing key, and once you call it a key the handling becomes obvious: put it where your SSH keys, your signing authority and your certificates already live, with the same review and rotation discipline.

Rotation is where the analogy stops, and how hard it stops depends on the account model. An SSH key is replaced by adding the new public key and dropping the old one. For an externally owned account the address is derived from the key, so there is nothing to swap: moving control means moving everything the address holds, on chain, with fees and a public trail. A smart contract account separates the two, and Gnosis Safe’s OwnerManager at v1.3.0 has a swapOwner that replaces an owner while the contract address and its holdings stay put.

What this means for teams

Nothing here asks you to have an opinion about the price of anything. The work is ordinary: one more external dependency to design around, one more class of secret to hold, and a vocabulary built to make simple ideas sound like a frontier.

That vocabulary is worth attacking first if you want to be useful here. Learn the cryptography underneath and the terms stop mattering: symmetric and asymmetric keys, what a hash function gives you, and how two parties agree a secret over a line anyone can read, which Whitfield Diffie and Martin Hellman published in 1976. You don’t need to break Enigma. Enough to recognise that a wallet is software wrapped around a key pair, an address is derived from a public key, and signing a transaction is signing.

Three things worth doing this week:

  • Write down which provider each chain read goes through, which reads may be stale, and which have to be proved against a block header. Pin any cross-check of two providers to the same block hash, and read a mismatch as a reason to investigate rather than proof of which one is bad. Failover handles the outage, not the wrong answer.
  • Inventory the keys that can move value: where each was generated, who can use it, whether its account is externally owned or a contract, and what rotating it would cost.
  • If you point at off-chain assets, test the reference itself, hop by hop. Can the tokenURI be repointed, does anything on chain commit to the image bytes by hash, and who is paying to keep those bytes online? Put those answers in the product copy, beside the rights the terms of sale actually grant.

Common questions, answered

How do I keep my dApp running when the node provider has an outage?

Treat the provider as a single point of failure and put a second one behind a switch. That covers availability: the call that times out or returns a 5xx. Correctness is the quieter problem, because an ordinary eth_getBalance reply carries no signature, so a well-formed wrong answer looks exactly like a right one. Pin any comparison of two providers to the same block hash, or honest nodes answering about different blocks disagree for no reason. Even pinned, a mismatch says go and look, not which side is wrong. eth_getProof verifies an account or storage value against a block header you believe.

How do I check what an NFT actually points to before buying one?

Call tokenURI on the contract, fetch what comes back, and look at the image field. ERC-721 makes that metadata extension optional, so some tokens carry no link. Where there is one, the standard says the URI may be mutable and requires no hash commitment to what sits behind it. Follow every hop: a frozen, content-addressed JSON still proves nothing about the artwork if its image field is an ordinary https:// URL whose bytes can be swapped. Some collections commit at each step, with an on-chain image hash, a content address for the image itself, or the whole artwork stored on chain.

Do I need to be PCI DSS compliant if I take payment in crypto?

Taking payment in cryptocurrency puts no card data in your systems, so it creates no PCI DSS scope of its own. Any card flow alongside it still needs its own assessment, and outsourcing that flow does not hand off the obligation. The crypto side has C4’s CryptoCurrency Security Standard, though publishing one settles nothing about who must comply. Ask any custodian which requirements they are held to and which assessment reports they can show.

Resources

Since we recorded

The energy argument changed shape when Ethereum switched to proof of stake. The Merge happened on 15 September 2022 and cut that chain’s energy consumption by an estimated 99.95%. Regulation arrived in Europe: Regulation (EU) 2023/1114, known as MiCA, covers crypto-asset issuers and service providers, and we worked through what it asks for in EU Compliance 101: DSA, MiCA explained. The custody warning aged well: the SEC charged FTX founder Samuel Bankman-Fried in December 2022 over the undisclosed diversion of customer funds, which is the failure mode of leaving your coins with someone else.