Hot answers tagged

23

Solidity and Serpent have ecrecover for this purpose. ecrecover(bytes32 data, uint8 v, bytes32 r, bytes32 s) returns (address) The function arguments are: data is what was signed. Since it is 32 bytes, that usually means that the initial data is hashed first to 32 bytes, before it was signed. v, r, s is the signature. (v is the recovery id: a 1 ...


13

Answer I don't think there is a "limitation" to Solidity being able to implement low level features/accesses, such as the types of things Serpent can do. However, the two languages may have different priorities. Serpent is likely focused on lower level features compared to the flagship high-level language Solidity. Ethereum high-level languages in order by ...


11

Vyper is the successor to Serpent. It is under active development, mainly by Vitalik himself. References: Vyper


10

With regards to why Serpent was deprecated, Vitalik recently Tweeted that he considers Serpent to be "outdated tech". The Serpent README has been updated in the last couple of days with the following: Being a low-level language, Serpent is NOT RECOMMENDED for building applications unless you really really know what you're doing. The creator ...


9

The Yellow Paper mentions an EVM opcode EXTCODECOPY which copies an account's code to memory. The answer appears to be yes: a contract can access the code of another contract. Solidity 0.3.1 now provides extcodecopy and other opcodes as part of its inline assembly feature: The following example provides library code to access the code of another ...


9

According to Vitalik Buterin here: The constraint is to preserve a property that history is irrelevant past a certain point and state is all that matters; it improves efficiency and code simplicity for many kinds of nodes. The 256 block limit is also mentioned in the Ethereum Yellow Paper by Gavin Wood at page 25. I would argue that an on-chain service ...


6

You can find the parser's source code in the ethereum/solidity project, it's written in C++. Here's the main implementation file: Parser.cpp You can find the main repo where solidity is linked and which contains the required dependencies to build it in the webthree-umbrella project repo. Here's a direct link to the wiki for installing it, you don't need ...


6

While Serpent uses a syntax very similar to Python, there are some important differences to be aware of: Python numbers have potentially unlimited size, Serpent numbers wrap around 2^256. For example, in Serpent the expression 3^(2^254) surprisingly evaluates to 1, even though in reality the actual integer is too large to be recorded in its entirety ...


6

pythereum and pythapp - your question tags - are Python implementations of Ethereum's core library and command line client respectively. They are orthogonal to the language in which smart contracts are written. So the short answer to your question is: no. Having said that, have a look at Serpent: https://github.com/ethereum/wiki/wiki/Serpent


4

Strings in Serpent are represented 2 different ways. Short strings created with quotes e.g. "bob" are represented as integers. While longer strings, those created by using Serpent's text() function are treated internally as an array. Serpent provides 2 functions you can use to store and load strings - save() and load(). Here's an example: data info[](...


4

Take a look at our security audit for Serpent to see why. Basically, it's very a bad quality, untested and unmaintained insecure project.


4

Ethereum smart contracts need to compile to EVM (Ethereum Virtual Machine) bytecode. There are no Python to EVM compilers, and for some of the challenges, see What is the merit of creating new smart contract languages like Solidity instead of using other languages? The options are to use a Python-like language Serpent or a recent (Nov 2016) experimental ...


3

I will attempt an answer at the technical parts of the question. I had the same thought about history repeating itself or writers not knowing what they were talking about when I saw the touting of multiple languages as a feature intrinsic to NEO to the exclusion of Ethereum. The short answer is no, the lack of language support in Ethereum is not an ...


3

If there are no Fundamental limitations between Solidity and Serpent, transitioning from Serpent to Solidity, should be like porting from one language to another, say Python to Javascript. Code has to be rewritten, in some parts of the code the translation is easy, in other parts the porting may require more work: but it should be feasible and practicable. ...


3

Serpent has no private methods: all functions are callable externally, which could be exploited to bypass certain input validation or preconditions. The BTC Relay security Audit revealed such a problem.


2

There is browser solidity, which allows you to compile but does not seem to include the full functionality of EtherScripter: http://chriseth.github.io/browser-solidity/


2

Here are two resources that may or may not be outdated, but provide a good overview of Serpent commands available. Note: It is not necessarily comprehensive. https://ethereumbuilders.gitbooks.io/guide/content/en/serpent_tutorials.html https://mc2-umd.github.io/ethereumlab/docs/serpent_tutorial.pdf


2

Vitalik just added support for delegatecall to Serpent, which answers my question by making my method obsolete. You use it by adding call=delegatecall to your functions calls.


2

A and B are functions in the same contract. The issue described is that a naive implementation of B can be invoked by anyone. Serpent currently doesn't have a "private" modifier which could be attached to specific functions, so that invoking it from outside the contract causes an exception. The way to do that for now is to check that the caller (msg....


2

Arbitrary Split approach Edit: Added this section to address arbitrary split destinations By the time you are splitting, you should know the length of the target data. Below is an example implementation of copying the bytes to their destination inside solidity, which should be trivially extendable to N buckets. pragma solidity ^0.4.15; contract HelpLogs {...


2

This library is a good starting point: https://github.com/HarryR/solcrypto As Richard points out symmetric key crypto and private key operation are rarely sensible in a smart contract as the smart contract has no privacy. However public key operations like checking signatures, proofs and hashes can be very useful and got more efficient with the addition of ...


2

Remember that anything done inside a smart contract has to be paid for with gas: computational expense equates to gas expense. Even if high gas costs aren't a deterrent, there's still a per-block gas limit that would need to be considered. (I don't know much about implementing crypto alogorithms, but I checked the OpenSSL C implementation of ECDSA, and it's ...


1

Solidity is already the de-facto DApp language: Serpent is deprecated, and neither Viper nor Bamboo are mature enough for widespread use. Nearly all DApp projects are using Soldity. This may change as and when these new projects mature, however.


1

The example is in Serpent. data domains[](owner, ip) def register(addr): if not self.domains[addr].owner: self.domains[addr].owner = msg.sender The keyword data declares a variable with persistant storage. In the example it is declaring an array of tupples, each tupple has two members owner and ip. For more info check the A Programmer's Guide ...


1

All function calls within the same contract (except those explicitly marked external) are implemented as JUMPs in Solidity by default.


1

My first problem was that I was running an older version of Serpent (v 1.6.7), that still suffered from the bug described here. My second problem was due to a typo in the Serpent tutorial here: to test the installations, the command is python -m pytest test_contracts.py (in the Serpent tutorial, the "-m" was after "pytest", not before it). I updated my ...


1

ArabianChain is developing one using blockly as well and it'll cover Solidity, Serpent and Thuraya. It'll be ready in June 2017. this is a pre-launch video , not that attractive yet but it'll show the builder. https://www.youtube.com/watch?v=MbaZ6f4AFhs


1

Are you supplying enough gas for deployment? Before homestead, contracts can deploy without code if you run out of gas during deployment.


1

This is not exactly a comparison of the two languages, but is relevant for someone looking to consider one over another. An audit has founded critical bugs in Serpent, with the auditors calling Serpent project "low quality" and "flawed." Vitalik, who wrote Serpent, said this in a tweet: "PSA: I now consider Serpent outdated tech; not nearly enough safety ...


Only top voted, non community-wiki answers of a minimum length are eligible