Convert Figma logo to code with AI

aeternity logoaeternity

æternity blockchain - scalable blockchain for the people - smart contracts, state channels, names, tokens

1,073
241
1,073
289

Top Related Projects

Substrate: The platform for blockchain innovators

:chains: A Framework for Building High Value Public Blockchains :sparkles:

Go implementation of the Ethereum protocol

15,893

Hyperledger Fabric is an enterprise-grade permissioned distributed ledger framework for developing solutions and applications. Its modular and versatile design satisfies a broad range of industry use cases. It offers a unique approach to consensus that enables performance at scale while preserving privacy.

Algorand's official implementation in Go.

Quick Overview

Aeternity is an open-source blockchain platform designed for scalable smart contracts. It aims to address scalability issues in blockchain technology by implementing state channels, oracles, and a unique consensus mechanism called Bitcoin-NG.

Pros

  • Implements state channels for off-chain transactions, improving scalability
  • Uses a hybrid Proof-of-Work and Proof-of-Stake consensus mechanism
  • Supports oracles for real-world data integration
  • Offers a functional programming language (Sophia) for smart contracts

Cons

  • Relatively new project with a smaller developer community compared to established blockchains
  • Limited adoption and ecosystem compared to more popular platforms
  • Complexity of the platform may present a steeper learning curve for developers
  • Faces strong competition from other scalable blockchain solutions

Getting Started

To get started with Aeternity, follow these steps:

  1. Install the Aeternity node:

    git clone https://github.com/aeternity/aeternity.git
    cd aeternity
    make
    
  2. Start the node:

    ./bin/aeternity start
    
  3. Interact with the node using the HTTP API or SDKs available for various programming languages.

  4. To develop smart contracts, use the Sophia language and deploy them using the provided tools or SDKs.

For more detailed instructions and documentation, visit the official Aeternity documentation at https://docs.aeternity.com/.

Competitor Comparisons

Substrate: The platform for blockchain innovators

Pros of Substrate

  • More active development with frequent updates and contributions
  • Extensive documentation and tutorials for developers
  • Flexible and modular architecture allowing for customizable blockchain creation

Cons of Substrate

  • Steeper learning curve due to complex architecture
  • Larger codebase, potentially requiring more resources to maintain
  • Rust-based, which may be less familiar to some developers compared to Erlang

Code Comparison

Substrate (Rust):

#[pallet::weight(10_000 + T::DbWeight::get().writes(1))]
pub fn do_something(origin: OriginFor<T>, something: u32) -> DispatchResult {
    let who = ensure_signed(origin)?;
    <Something<T>>::put(something);
    Self::deposit_event(Event::SomethingStored(something, who));
    Ok(())
}

Aeternity (Erlang):

-spec spend(aec_keys:pubkey(), non_neg_integer(), non_neg_integer(), aetx:tx_ttl(), aec_keys:pubkey()) ->
                   {ok, aetx:signed_tx()} | {error, term()}.
spend(RecipientPubkey, Amount, Fee, TTL, SenderPubkey) ->
    {ok, Tx} = aec_spend_tx:new(#{sender_id => aeser_id:create(account, SenderPubkey),
                                  recipient_id => aeser_id:create(account, RecipientPubkey),
                                  amount => Amount,
                                  fee => Fee,
                                  ttl => TTL,
                                  nonce => aec_accounts:next_nonce(SenderPubkey)}),
    {ok, aec_keys:sign(Tx)}.

:chains: A Framework for Building High Value Public Blockchains :sparkles:

Pros of Cosmos SDK

  • More extensive documentation and developer resources
  • Larger and more active community, with broader ecosystem support
  • Modular architecture allowing for easier customization and extension

Cons of Cosmos SDK

  • Steeper learning curve due to its complexity and extensive features
  • Potentially higher resource requirements for running nodes

Code Comparison

Cosmos SDK (Go):

func (app *SimApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock {
    return app.mm.BeginBlock(ctx, req)
}

Aeternity (Erlang):

-spec begin_block_tx(aec_blocks:block()) -> ok.
begin_block_tx(Block) ->
    aec_tx_pool:new_block(Block).

The Cosmos SDK code snippet shows a more modular approach, utilizing the module manager (app.mm) to handle the begin block logic. Aeternity's code appears more straightforward but less flexible.

Cosmos SDK offers a more comprehensive framework for building blockchain applications, with a focus on interoperability and customization. Aeternity provides a simpler, more focused platform for smart contracts and decentralized applications.

Both projects have their strengths, with Cosmos SDK being more suitable for complex, interconnected blockchain ecosystems, while Aeternity may be preferable for simpler, more specific use cases.

Go implementation of the Ethereum protocol

Pros of go-ethereum

  • Larger and more established community, with extensive documentation and resources
  • More mature codebase with longer history of development and refinement
  • Wider adoption and ecosystem support, including numerous tools and dApps

Cons of go-ethereum

  • Higher complexity and steeper learning curve for developers
  • Slower transaction processing and higher gas fees during network congestion
  • Less flexible consensus mechanism compared to Aeternity's hybrid approach

Code Comparison

go-ethereum (Geth):

func (s *Ethereum) Start() error {
    if err := s.startEthService(); err != nil {
        return err
    }
    return nil
}

Aeternity:

start(Config) ->
    case aec_chain_state:start_link() of
        {ok, ChainPid} ->
            {ok, #state{config = Config, chain_pid = ChainPid}};
        {error, Reason} ->
            {error, Reason}
    end.

The code snippets show different approaches to starting the respective blockchain services. go-ethereum uses a more imperative style with error handling, while Aeternity employs pattern matching and a functional approach typical of Erlang.

15,893

Hyperledger Fabric is an enterprise-grade permissioned distributed ledger framework for developing solutions and applications. Its modular and versatile design satisfies a broad range of industry use cases. It offers a unique approach to consensus that enables performance at scale while preserving privacy.

Pros of Fabric

  • Broader enterprise adoption and larger community support
  • More flexible permissioning and privacy controls
  • Modular architecture allowing for customizable consensus mechanisms

Cons of Fabric

  • Higher complexity and steeper learning curve
  • Potentially slower transaction processing due to multiple layers
  • Less focus on native cryptocurrency functionality

Code Comparison

Fabric (Go):

func (s *SmartContract) CreateAsset(ctx contractapi.TransactionContextInterface, id string, color string, size int, owner string, value int) error {
    asset := Asset{
        ID:    id,
        Color: color,
        Size:  size,
        Owner: owner,
        Value: value,
    }
    assetJSON, err := json.Marshal(asset)
    if err != nil {
        return err
    }
    return ctx.GetStub().PutState(id, assetJSON)
}

Aeternity (Sophia):

contract AssetRegistry =
  record asset = {
    id : string,
    color : string,
    size : int,
    owner : address,
    value : int }

  stateful entrypoint create_asset(id' : string, color' : string, size' : int, owner' : address, value' : int) =
    let asset = { id = id', color = color', size = size', owner = owner', value = value' }
    put(state{assets[id'] = asset})

Both examples showcase asset creation, but Fabric uses Go with a more verbose JSON approach, while Aeternity uses Sophia with a more concise record-based structure.

Algorand's official implementation in Go.

Pros of go-algorand

  • Written in Go, which offers better performance and concurrency handling compared to Erlang
  • More active development with frequent commits and releases
  • Larger community and ecosystem support

Cons of go-algorand

  • More complex codebase with a steeper learning curve
  • Higher resource requirements for running a node
  • Less focus on scalability compared to Aeternity's state channels approach

Code Comparison

go-algorand

func (node *AlgorandFullNode) Start() {
    node.net.Start()
    node.ledger.Start()
    node.agreement.Start()
    node.txHandler.Start()
}

aeternity

start() ->
    aec_db:load_database(),
    aec_chain_state:start_link(),
    aec_peers:start_link(),
    aec_tx_pool:start_link(),
    aec_conductor:start_link().

Both projects implement similar node startup processes, initializing core components like networking, ledger/chain state, and transaction handling. However, go-algorand's implementation in Go offers a more concise and readable syntax, while aeternity's Erlang code leverages the language's built-in concurrency features with the start_link() calls.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Aeternity node

CircleCI License Build Tool

A new blockchain for æpps.

Optimized for scalability via smart contracts inside state-channels.

Has a built-in oracle for integration with real-world data.

Comes with a naming system, for developerability.

Written in Erlang.

To install and run the Aeternity node, see the instructions below or just follow the progress of the project via GitHub Issues.

If you have discovered a bug or security vulnerability please get in touch. The Aeternity Crypto Foundation pays bug bounties up to 100.000 AE Tokens for critical vulnerabilities. Please get in touch via security@aeternity-foundation.org.

Documentation

For an overview of the installation process for different platforms, building the package from source, configuration and operation of the Aeternity node please refer to Aeternity node documentation.

We keep our protocol, APIs and research spec in separate protocol repository.

How to start

We publish packages for major platforms on GitHub. Each release comes with release notes describing the changes of the Aeternity node in each particular version.

Please use the latest published stable release rather than the master branch. The master branch tracks the ongoing efforts towards the next stable release to be published though it is not guaranteed to be stable.

Quick Install

Linux / Mac

By using the installer to install the latest stable version:

bash <(curl -s https://install.aeternity.io/install.sh)

See the documentation for starting and configuring the node.

Docker

Alternatively, you can run the node client as a docker container:

Linux / Mac

Or running a docker container (latest tag):

mkdir -p ~/.aeternity/maindb
docker pull aeternity/aeternity
docker run -p 3013:3013 -p 3015:3015 \
    -v ~/.aeternity/maindb:/home/aeternity/node/data/mnesia \
    aeternity/aeternity

Windows

mkdir %APPDATA%\aeternity\maindb
docker pull aeternity/aeternity
docker run -p 3013:3013 -p 3015:3015 -v %APPDATA%/aeternity/maindb:/home/aeternity/node/data/mnesia aeternity/aeternity

Restore from snapshot

To speed up the initial blockchain synchronization the node database can be restored from a snapshot following the below steps:

  • delete the contents of the database if the node has been started already
  • download the database snapshot
  • verify if the snapshot checksum matches the downloaded file
  • unarchive the database snapshot

Note that the docker container must be stopped before replacing the database

The following snippet can be used to replace the current database with the latest mainnet snapshot assuming the database path is ~/.aeternity/maindb:

rm -rf ~/.aeternity/maindb/ && mkdir -p ~/.aeternity/maindb/
curl -o ~/.aeternity/mnesia_main_v-1_latest.tar.zst https://aeternity-database-backups.s3.eu-central-1.amazonaws.com/main_backup_v1_full_latest.tar.zst
CHECKSUM=$(curl https://aeternity-database-backups.s3.eu-central-1.amazonaws.com/main_backup_v1_full_latest.tar.zst.md5)
diff -qs <(echo $CHECKSUM) <(openssl md5 -r ~/.aeternity/mnesia_main_v-1_latest.tar.zst | awk '{ print $1; }')
test $? -eq 0 && tar --use-compress-program=unzstd -xf ~/.aeternity/mnesia_main_v-1_latest.tar.zst -C ~/.aeternity/maindb/

Additional resources