Building AI Security Tooling and Web3 Security

Lucas Martin Calderon on Building AI Security Tooling for Web2 and Web3


Ask me anything with Pentestify CEO: 0-1 journey of a smart contract auditor

Ask me anything with Pentestify CEO: 0-1 journey of a smart contract auditor


Are you starting your journey as a smart contract auditor ? This is a unique opportunity to learn from the experience of Lucas Martin Calderon, co-founder of Pentestify. 

Tune in on October 13th at 2.30pm BST:

Don’t know what to expect ? Here is a sequence from his last interview with DeFi talents: 

Blockchain, Cybersecurity and AI have been the 3 pillars upon which all my creations have been built. From programming the Bitcoin environment and mining coins using my own automatic software to becoming an Ethereum contributor and DAO developer, I have come a long way since 2016 and now advise tier 1 banks, DeFi protocols and SANS students in blockchain and smart contract security”

“My professional journey began as a software engineer at Deutsche Bank, in the heart of London’s financial district. Though it was a role many would covet, my entrepreneurial spirit led me to accept a unique opportunity at STATION F, the world’s largest startup incubator in Paris, as my team and I got accepted. This choice marked the start of my journey into the transformative intersection of artificial intelligence (AI) and smart contract security in ways that I could have not foreseen. This was equally around the time where I got awarded SuperNova Under 30, by Nova Talent, in the realm of cybersecurity and computer science in Spain.

“Born from this pursuit was Pentestify, my brainchild and current primary focus. As the founder and CEO, I’ve dedicated myself to creating a pioneering platform that automates the detection of smart contract security vulnerabilities using cutting-edge AI models. With esteemed partners such as the University College London and global tier-1 banks, Pentestify has rapidly evolved into an industry-leading SaaS solution in the blockchain security space.

My international upbringing and education, spanning France, Germany, Spain, and the UK, have indubitably shaped my unique perspective on technology. I’ve always championed a growth mindset, which has been instrumental in my public learning approach, fueling my constant desire to broaden my horizons and master new skills.

As my career progressed, I found myself at the intersection of various ventures, from co-founding Web3Sec, a globally recognized blockchain security news aggregator newsletter, to launching zkToro, a DeFi protocol designed to enhance social trading while preserving user privacy, which I believe will undoubtedly pioneer the field of privacy-enhancing quant trading in the upcoming years”

Pentestify joins the ranks of Europe’s top 50 blockchain startups – European blockchain convention

Pentestify joins the ranks of Europe's top 50 blockchain startups - European blockchain convention


The European Blockchain Convention gathers 5,000+ crypto and blockchain enthusiasts, 300+ speakers from leading blockchain companies, and 200+ exhibitors for 2 days in Barcelona. 

Each year, the European blockchain convention organises the EBC Startup Battle, which is the largest early-stage blockchain startup competition in Europe.  In each edition, 50 finalist startups are carefully selected from a vast pool of applications to pitch their ideas in front of everyone. 

As one of the finalists, Pentestify will be pitching and get a chance to win the €35,000 award granted to the winner of the competition. Beyond the competition, we truly look forward to meeting the other promising startups as well as connecting with other leading blockchain companies out there.

Barcelona here we come ! 🚀

Scraping Bits Podcast: Pentestify’s Penetration – Generating Smart Contract Exploits With AI DRL

Scraping Bits Podcast: Pentestify's Penetration: Generating Smart Contract Exploits With AI DRL - Ft. Lucas Martin Calderon


Pentestify co-founder Lucas Martin Calderon was invited to DeGatchi‘s Scraping Bits Podcast 🎙️🎙️ to talk about his journey as an entrepreneur in field of cybersecurity and how Pentestify represents the culmination of all his work in cybersecurity, blockchain and AI over the last decade 🔥

Before diving into how Pentestify is revolutionising smart contract security auditing with AI, DeGatchi and Lucas Martin Calderon talk about the evolution of AI and blockchain, as well as how our right to privacy 🔓 has reached a crossroad where two possible outcomes can occur depending on how we decide to use blockchain technology in the next couple of years…

Tune in to hear more about how we see the blockchain security space evolving over the next two years, as well as Pentestify’s plans for the coming months 🤫

Thanks for having us DeGatchi ! We really enjoyed the chat 

DappCon23 Day 2 – Blockchain Security Marries AI by Lucas Martin Calderon

DappCon23 Day 2 - Blockchain Security Marries AI by Lucas Martin Calderon


Pentestify CEO, Lucas Martin Calderon was invited to the Dappcon 2023 Summit to talk about marrying AI and blockchain security.  In this talk, Lucas goes back to the basics of how AI actually works in order to get a better understanding of where it is heading: “Getting the basic right will help make a product that truly makes a difference and that will have the biggest impact”.  He then ties the latest development in both open and closed source AI models, their advantages and disadvantages and why Pentestify chose DRL and GNNs models to build NEO:  Automated, post deployment smart contract vulnerability detection and remediation SaaS. 

Find the full transcript below: 

Hello everybody! 

I’m super happy to be here especially because I’ve been thinking quite a lot about what to speak about today. Whether to speak quite technically about what AI is or comparing our tools to other world leading tools like static analyzers Dynamic analyzers or formal verification tools but at the end of the day I decided to truly to maximize the impact and go back to the basics of how AI works to understand where the future is heading so you can have the bases right and hence develop a product that really makes a difference.

As Elon Musk says: “one of the problems with with entrepreneurs with smart Engineers smart people is that we focus on the wrong problems so we try to optimize and maximize  problems that of things that shouldn’t even exist”

So who here in this room is afraid of AI replacing your job or actually taking a bit of your job, are there any takers?

Well by the end of this if you feel a little bit worse then that means that I’ve done a a good job.

Today we are going to talk about how a AI works why you should fear AI the ways to think about it. Same for the exact same thing for for the blockchain

So what is a neural network ?

You already have some inputs in the middle of the inputs and the outputs that’s where the layers come in right ? That’s where you have some weights. The weights could mean how strong the system, how strong the relations between these variables is and then those “B”s represent the bias so in a loss function of an AI model that means to minimize the error the loss function the cost function.  Then you have an activation function which could be softmax reu sigmoid to simplify the output. Finally you have the outputs which generally could be:  it’s a car, it’s a carpet, it’s a mug or that would be classification or it could be regression regarding numbers and so on.  So again we’ve talked a lot about and we’ve heard about uh chat GPT, LLMs, Transformers. What they do how they work. And I would like to give a very basic explanation but yet enough for you guys to understand why chat GPT or different LLMs wouldn’t be able to or wouldn’t be apt for certain vulnerabilities and so on.

I don’t know if you can read it well but chat GPT is made of or Transformer networks is made of encoders and decoders right ?

Encoders get your input when you put text into chat GPT and decoders actually get that context and decode and output the end result right? And it’s quite easy and well it’s quite important to understand how self attention works, that actually comes from a paper from Google called attention is all you need from 2016, it is quite quite old but it’s the basics for all we’ve got right now. So if you want to use these tools to find vulnerabilities in smart contracts that’s a bit more tailored to Smart contract security auditors, you already start wrong if you use a pre-train model.  Why? Because the attention mechanism of LLMs or of chat GPT is already tailored to optimize and maximize the probability of the next word right ? So according to your questions according to the tokens and the whole embedding what is the probability of the next word popping up right ? 

This is important to know because if you think about mathematics, if the smart contract does some mathematical reasoning. When you ask it 5 + 5 and it outputs 10 it doesn’t know what 10 means or it doesn’t know what addition means or what five represents/signifies. It simply means that after all the terabytes of training data, academic papers and so on, most of the time uh most of the times there is a 10 at the end of the thing so do you want that to be piloting/driving the security of your web3 company ? I I definitely hope no.

So when when thinking about all these things, on the right as you can see that’s that’s simply how AI sees the input text that you put. When we call artificial intelligence is it really intelligent ? how intelligent is it ? 

The stability CEO of stability AI said that by the end of 2024, and I might be wrong about this but we will be able to have chat GPT on our phones downloadable. And the size would be 5GB more or less.

Doesn’t that mean a lot already ? You’re able to train on terabytes of data.  You’re able to put a big portion of the internet, of the best books, of the smartest academic papers and then you’re able to download all that information into 5 gigabytes. 

Are we talking about a sort of compression algorithm ? Are we talking about something else ? Well that something else is what we interpret as intelligence but however we plan to transpose our intelligence to what this AI how AI works right ?  Which is something completely different and this is why when really thinking about security and even though certain models might output certain vulnerabilities of smart contracts,  you truly need to understand how it works first, what kind of intelligence or compression algorithm it has,  or pattern recognition, to know the limits of its creativity, of how it works and so on.  

This image is simply what the AI sees in the in the first step. 

So if you see on this slide, these are the word embeddings. All the features and all the rows, each row is a token and each column is a feature of the token, a dimension. A dimension could represent different things that we couldn’t even imagine in that case it might be word similarity semantic similarity and it’s quite important for the self attention algorithm.

This is taken actually from Jay Alsom one of the best Illustrated Engineers that are able to express with graphics how AI works and in this case for example, it says “the animal didn’t cross the street because it was too tired” when you refer back to the whole graph to the whole way of seeing things by the AI, what does it represent ? Does it go back to the animal or does it mean the street right ? 

This is where attention comes in and where it’s tailored to certain parameters. In this case, chat GPT is tailored to make sense for the questions that the user asked them but it’s definitely not engineered, or made to find vulnerabilities in smart contracts.

Now however, we would like to talk about the opposite of the Monopoly of AI and why AI companies should fear AI. Why it is really down to the community, and this is the message that I want to put across it should be up to us, up to the community to really drive and set the pace for the future of the developments in web 3 including AI and blockchain and not to these big corporations.

So GPT4 was the first commercially available one, even though Google started way before. Then we’ve got Cohere, Stability AI, Anthropic. In this case it even seems that Mark Zuckerberg is actually one of the good guys as Meta is one of the biggest research companies putting their the research out there for free. 

This is how fast AI has been working. Since the first activity was released on February 24th Lama was released but it was open source and yet the weights of the model, which means the intelligence after the training model, they were private somehow they got released from forchan, and since then there has been a super fast acceleration of of people building on top of these tools. To give you an exampl, on March 13 it was already running on consumer Hardware, on March 19th “Vicuna” and other models already surpassed Google’s “Bard”, so something that was around $200 million to train in the AI uh database and Computing zones. It already takes $300 uh to to fine-tune the model. Fine-tuning simply means making it better after it’s already been pre-trained or tailored to your needs.

GPT for all launches and it already creates an entire ecosystem, the biggest LLMs open source libraries like “Lang Chain” like Wev8 the vector database already tried to pop up and catch up with a speed. 

On March 30th Bloomberg GPT launches and shortly after FiGPT, so Finance GPT the open source version of that launches as well so as you can see since the model, since the weights of Lama were put uh out in the wild by well definitely not by meta but by someone else, I guess an Insider. In in less than six weeks we were already able to get the same performance or very similar accuracy F1 scores precision than models that took years of development and hundreds of millions of of dollars to train so this is again the mote. There was as well a leaked um article by Google saying “open AI has no mote and neither do we”.  By mote they simply mean Competitive Edge or competitive advantage. It was already possible given certain Technologies certain advancements in the field of AI allowed all of that to to happen, however it is important to note that you’re able to fine-tune the model simply by prompt so you don’t need to do that technically prompt and giving context already kind of helps that out.

However speaking of the technologies that actually helped the open source Community carry all this advancement forwards and actually achieve the same precision than Google or Open AI were two main Technologies: quantization and Lora. Lura is not to be confused in the electronics field but it is a lower rank adaptation that allows actually to reduce the number of trainable parameters by 10,000 times which actually reduces and helps free up the bottleneck of AI training which is generally the GPUs. Then quantization means faster inference, it saves money and when the training happens and an inference you’re able to reduce the vector space which is used to train the model.

Now the problems with generative AI and this is really where the research that I’ve been doing at Pentestify in collaboration with University College London, we really wanted to approach it in the most natural way, and by natural I mean one of the humans best inventions or rather than inventions, executions and Engineering achievements were actually when we observed nature. So what best to represent how a human finds vulnerabilities and things of vulnerabilities than actually studying the brain and how it interacts when presented with a smart contract ?

So we took 50 Smart contract auditors and we put them on an MRI machine to know the areas of the brain that activated when doing these things.  A lot of noise happened but we were thank god helped by medical professionals that know exactly how to interpret and read that data, and actually it aligned very well with the philosophy at the beginning that we carried at Pentestify. It was what kind of AI should we develop to uh to really find vulnerabilities without having the same weaknesses as open AI or Chat GPT. Again we don’t want to optimize a problem of an issue that shouldn’t exist in the first place right ? 

So we realized that the answer was actually the true intelligence for this very specific task was mixing different types of intelligence and we realized that when spatial and vision activated in the brain there’s already an AI model tailored for that and it’s called graph neural networks that are able to think sequentially through time and through functions. Again, as smart contract auditor when you’re creating or auditing the code you might think of the control flow or data flow diagram right? But you might be thinking directly with all the different function calls across time or in a different order that it was already meant to. So graph neural networks are indeed able to to achieve that task and have different information in parallel at the same time. 

The language area in the brain already was quite active and for that we use part of LLMs like chat GPT but only up to the embeddings point and the embeddings against it is the representation of the tokens of the words that you put in and we wanted to make sure that the attention algorithm, the attention mechanism was tailored to find vulnerabilities  instead of to understand the semantic context of it. Because at the end of the day we don’t want the AI to understand the smart contract per se, the semantics of it and we want to understand the different in instruction sets and its interactions with the evm. There were a bunch as well of of algorithms like short-term long memory, algorithms and so on for prediction, mathematical reasoning that we already know that it might not be the best at in fact even though it improves it, it is definitely from the base from scratch the wrong algorithm to think and the wrong AI model to think for for these things.

The way blockchain evolves, the good ways the bad ways. Well the fact that that is on red doesn’t mean that I don’t agree with with those two but are definitely something that we should take into consideration. The fact that both things exists at the same time and the need for both things to exist at the same time. For the first time in history our money in banks will be programmable that means that if you receive money from your job or from even your own venture you might need to spend it in a timely manner because otherwise you could get burned or you won’t be able to route it through certain channels because it would be forbidden. Again control has never been so active.

 So what is the best way to marry blockchain and AI in the context of security ? And why is it so interesting to mix them ? Is it simply because in web 2 AI was so prevalent ? Well in this case it really helps the infrastructure of blockchain the availability of the data is there for the first time public. We’ve given up uh the control for our data to be public, for certain transactions to be public for at least the pleasure of not being stored in a centralized server that someone else controls. 

The sector is about to change as well with different encryption schemes: FHE,  ZK are definitely there to change the game and if you want to simulate different attacks on the blockchain it’s never been so easy with an infrastructure that you can Fork that you can literally copy and simulate.  

Why is the security aspect so important ? Even though uh this is not a double sale that I to make here I’m sure but in 2023 alone there was over three billion stolen dollars. 70% came from Smart contracts and 92% of the smart contracts were already audited by top firms. This is nothing to say of these top firms but rather the fact that it evolves. That new vulnerabilities have been found, and when referring to most tools, so static analyzers and dynamic anal analyzers… they have predefined instructions, predefined vulnerabilities so again the very basics of AI, of deep learning is being able to train to inference on unseen data and being able to infer new vulnerabilities that you haven’t even learned the patterns before. Or hasn’t been entered by an expert.

So that’s what we do at Pentestify through five different AI models. You simply give us the address of the smart contract and we get all the vulnerability, all the dependencies, all the graph from the different smart contracts and across time we continuously monitor it. We extract the vulnerable patterns we store them in a database and although many of them are not vulnerable but given that it is in a multi-dimensional space that not even humans can understand as you saw in the graph embeddings AI uses way more dimensions that what we can possibly imagine, that remains on the database until a smart contract with a similar uh vulnerability is found and then we alert the team immediately. We are also able to find uh variations of vulnerabilities like reentrancy that a static analyzer wouldn’t detect unless it receives an update.

So yeah thank you very much more than happy to answer any questions now or after. I was only able to touch upon an overview many many topics but happy to answer any questions.

Yes now it’s time for questions so if anyone has questions please raise your hands

Lucas Martin Calderon – Speaker for the DappCon summit 2023

Lucas Martin Calderon - Speaker for the DappCon Summit 2023


Pentestify’s CEO has been invited to the DappCon Summit 2023 to give a talk on the role AI can play in detecting and remediating smart contract vulnerabilities for DeFi protocols.  Lucas will be covering the latest tools and techniques used by top smart contract security auditors and demonstrating the latest advancement in AI in comparison to traditional formal, dynamic and static security auditing methodologies. 

Book your tickets here.

When Innovation Turns Into a Vulnerability: VanMoof’s Insolvency and What It Means for DeFi Protocols

When Innovation Turns Into a Vulnerability: VanMoof’s Insolvency and What It Means for DeFi Protocols


On July 12, Dutch e-bike company VanMoof, a once celebrated innovation story in the world of electric bicycles, declared bankruptcy, leaving its customers in the lurch. The company’s collapse exposed a previously hidden flaw in its product design: without VanMoof’s servers operating, the company’s premium e-bikes risk becoming inoperative. This incident, unfortunate as it is for VanMoof’s customers, has valuable lessons for the decentralized finance (DeFi) sector.

The VanMoof “Business Logic” Vulnerability

VanMoof’s e-bikes were controlled via smartphones through a Bluetooth connection that relied on encryption keys from VanMoof’s servers. When the company filed for bankruptcy and its servers went offline, customers lost the ability to obtain this key, effectively rendering their e-bikes useless.

While innovative enthusiasts quickly created a third-party tool to access this encryption key, the incident exposed a critical vulnerability. A €2,500–3,000 / $2,700-$3,200 smart bike could be rendered useless because of server-side issues. This raises pressing questions about ownership rights and device operability in the face of company insolvency.

The DeFi Parallels

This scenario isn’t entirely foreign to the DeFi sector. While DeFi prides itself on its decentralization and trustless protocols, there are instances where certain aspects of a project remain centralized. This centralization becomes a point of vulnerability when the parent company or development team faces financial or legal difficulties.

Much like how VanMoof’s e-bikes were dependent on the company’s servers for operation, DeFi protocols often rely on the parent company for various functions, from maintenance and updates to oracle services and governance decisions. This centralization puts the protocol’s users at risk in the event of the company’s insolvency.

Moreover, just as e-bike owners found themselves locked out of their devices, DeFi users could find their assets frozen or lost if the parent company fails. Given the substantial financial stakes involved, these risks are of grave concern to users and should be at the forefront of protocol development considerations.

Strengthening DeFi Against Insolvency Risks

To avoid a VanMoof-style scenario in the DeFi space, it is crucial to engineer protocols that can survive the potential insolvency of the parent company. Here are a few strategies to consider:

1. True Decentralization: The first and most obvious step is to reduce any centralized control over the protocol as much as possible. This includes decentralizing the governance of the protocol, updates, and other critical functionalities. Distributing control over multiple independent actors will ensure the continuity of the protocol irrespective of the parent company’s status.

2. Emergency Shutdown Mechanisms: Incorporate an emergency shutdown mechanism in the protocol design to protect users’ assets. In the event of a system failure or insolvency, this mechanism will freeze the system in a state that allows users to safely withdraw their funds.

3. Open Source and Modularity: Make the protocol open source and modular to allow other developers to fork, maintain or upgrade it in the event the parent company is unable to do so. This also fosters a community of developers who can act as a backup if the original development team is incapacitated.

4. Decentralized Autonomous Organizations (DAOs): Establishing a DAO to oversee the protocol can ensure that the community retains control over the protocol’s future. This can involve making decisions about updates, handling treasury, and even restructuring the protocol in the event of the parent company’s insolvency.

5. Insurance: Finally, integrating insurance provisions into DeFi protocols can provide a safety net for users. Whether this is done through native mechanisms or through third-party services, insurance can give users confidence that their assets are protected even in the worst-case scenarios.

The lessons from the VanMoof bankruptcy are clear: innovations in technology, while providing novel and exciting opportunities, also come with new risks and vulnerabilities. As the DeFi sector continues to innovate and push boundaries, it is critical to keep these vulnerabilities in mind and build protocols that can endure the trials of time and the turbulence of the business world.

Pentestify team wins third place at the ETHGlobal Hackathon

Pentestify team wins third place at the ETHGlobal Hackathon


Pentestify’s CEO Lucas Martin Calderon and his team attended this year’s ETHGlobal Hackathon. They powered through 40+ hours coding non-stop on a new project, HedgeHog, which is designed to hedge against impermanent loss using Uniswap Labs v4’s (unaudited and experimental) smart contracts to create a limit order, represented as tradable NFTs, and whose premium is dictated by a powerful AI model. This entire process was made possible using Cartesi‘s optimistic rollup earning us third prize! 

Github Rep

Do you know the key differences? DeFi 1.0 vs DeFi 2.0 in 2023

DeFi 1.0 vs DeFi 2.0 in 2023


Do you know the key differences ? 👀

  1. DeFi 1.0 protocols were primarily dependent on attracting liquidity by allocating a substantial portion of their native tokens into liquidity mining incentives. For example, SushiSwap, a popular decentralized exchange, incentivized users to provide liquidity by offering generous SUSHI token rewards. However, these programs can be unsustainable as they could lead to an excessive supply of tokens, devaluing the native token over time. DeFi 2.0 protocols, on the other hand, are focusing on novel protocol designs and innovative tokenomics to attract liquidity. Uniswap V3, for instance, offers concentrated liquidity positions, allowing liquidity providers to earn more transaction fees by focusing on price ranges where they believe the most trading activity will occur. This is a more sustainable way to attract liquidity, as it doesn’t rely on inflationary token rewards.

  2. DeFi 1.0 was characterized by “hot potato” liquidity, where liquidity providers would jump from one protocol to another chasing the highest yield. This caused significant price instability for native tokens. For example, when yield farming rewards on the Yam protocol decreased, there was a rapid exodus of liquidity, which destabilized the token price. DeFi 2.0 seeks to foster loyal liquidity. Protocols like Alchemix are pioneering this trend by offering self-repaying loans, which gives users a compelling reason to keep their assets in the protocol long-term, fostering a more stable liquidity pool.

  3. In DeFi 1.0, the token price was often intertwined with the project’s overall perceived quality. A drop in token price could potentially destabilize the project, as was the case with Iron Finance’s stablecoin Iron Titanium token (TITAN), which experienced a bank-run type scenario, leading to a loss of confidence and collapse in price. To avoid such scenarios, DeFi 2.0 protocols are working on mechanisms to decouple the overall success of a project from the price of its native token. For instance, the Terra ecosystem uses an algorithmic stabilization mechanism to keep its stablecoin, UST, pegged to the USD, irrespective of the price movements of its native LUNA token.

  4. Vesting was a common practice in DeFi 1.0 to alleviate the issues related to liquidity mining. While this delayed immediate sell-offs, it didn’t eliminate the possibility. Once tokens were fully vested, token holders could still sell en masse, leading to price instability. DeFi 2.0, represented by protocols like OlympusDAO, is introducing bonding models where tokens are sold at a discount in exchange for other assets. This enables the protocol to own its liquidity. In effect, it’s buying back its tokens using treasuries funded by protocol profits, fostering long-term stability.

  5. DeFi 1.0 was heavily reliant on a protocol’s brand and reputation to retain users and liquidity once liquidity mining incentives ended. This was a limitation, as any reputational damage could lead to a rapid exodus of liquidity. Compound, for example, experienced a drastic reduction in liquidity when its liquidity mining program ended. In contrast, DeFi 2.0 is creating mechanisms that make it more appealing for users to stay, without relying on brand reputation. Curve Finance’s veCRV token, for instance, gives users voting rights and boosted yields, incentivizing them to lock their tokens for longer periods.

  6. Liquidity mining programs in DeFi 1.0 were usually limited to a certain amount of tokens, putting pressure on the protocols to succeed within a certain timeframe. Once the tokens allocated for rewards were exhausted, the protocol might struggle to retain liquidity. DeFi 2.0 is seeking more sustainable and long-lasting liquidity

DeFi security Summit 2023 – Session 4: AI Panel with Lucas Martin Calderon

Lucas Martin Calderon - Panel speaker for the DeFi Security summit 2023


Founder Lucas Martin Calderon was invited to the DeFi Security Summit 2023 to give a talk on the role AI will play in detecting and remediating smart contract vulnerabilities.  On this Panel, he shared his views on the latest techniques used by top smart contract security auditors along with the latest advancement in AI in comparison to traditional formal, dynamic and static security auditing methodologies. A particular focused was placed on the arrival of chat GPT and how auditors are using it’s models to enhance detection and response, and why Pentestify has chosen to build it’s own AI models for the development of NEO: Automated post deployment smart contract detection/remediation SaaS