Vote Poll Sdk

Waku Connect Vote & Poll SDK #

The Waku Connect Vote & Poll SDK enables developers to add Waku powered polling and voting features to their dApp.

The repository can be found on GitHub:

The SDK can be used in two different ways: to vote (commitment to the blockchain) or poll (no interaction with the blockchain).

For both functionalities, only ERC-20 token holders can create or answer polls/votes. The developer using the SDK can configure which ERC-20 token contract is used.

Documentation #

For either SDKs, you need to start by creating a dApp. To do so, you can follow the Create a DApp instructions.

Packages #

Common #

  • @waku/vote-poll-sdk-core: Common libraries to both vote and poll functionalities.
  • @waku/vote-poll-sdk-react-components: Common React components to both vote and poll functionalities.

Vote #

  • @waku/vote-sdk-react-components: React components.
  • @waku/vote-sdk-react-hooks: React hooks.
  • @waku/vote-sdk-contracts: Solidity contracts.

Poll #

  • @waku/poll-sdk-react-components: React components.
  • @waku/poll-sdk-react-hooks: React hooks.

Waku Connect Vote SDK #

The Waku Connect Vote SDK allows you to leverage Waku to save gas fees for most voters. It uses Waku to broadcast and aggregate votes. Most token holders will not need to spend gas to vote.

Only the party that starts an election and submit the end results need to interact with the blockchain.

For example, it can be used by a DAO to manage proposals where proposal creation and vote results must be committed to the blockchain.

With Waku Connect Vote SDK, the DAO could be the one spending gas when creating the proposal and committing the votes, whereas the token holders do not spend gas when voting.

Documentation #

You can find more information about the Vote SDK’s properties in the README.

See How to Use the Waku Connect Vote SDK.

Waku Connect Poll SDK #

The Waku Connect Poll SDK allows you to leverage Waku and enable token holders to create, answer and view polls. The polls are not committed to the blockchain and hence do not cost gas.

As the polls use Waku, they do maintain properties expected from dApps: decentralized and censorship-resistant.

The high-level functionality is as follows:

  • To create a poll, a token holder sends a message with the poll questions, possible answers and an end time over Waku,
  • Other users receive the poll creation message and can view the poll,
    • To avoid spam, only polls created by actual token holders are displayed,
  • Any token holder can send their poll answer over Waku,
  • Each user cumulates poll responses from Waku and can view them,
    • To avoid spam, only responses sent by actual token holders are displayed.

Documentation #

See How to Use the Waku Connect Poll SDK.