Skip to content

Commit

Permalink
integration guide standards ef sigmachains
Browse files Browse the repository at this point in the history
  • Loading branch information
glasgowm148 committed Apr 11, 2024
1 parent 8ff1c15 commit 3914d9a
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 39 deletions.
15 changes: 7 additions & 8 deletions docs/contribute/standards.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ This page serves as a guide for contributing as a project on Ergo. It outlines t

# | Description |
------- | --------------------------------------------------------- |
**3.1** | Ensure Telegram groups have anti-spam protection in place |
**3.2** | Ensure Discord groups have anti-spam protection in place |
**3.1** | Ensure Telegram groups have anti-spam/scam protection in place |
**3.2** | Ensure Discord groups have anti-spam/scam protection in place |
**3.3** | Work towards reducing friction between chats |
**3.4** | Strive to boost engagement |
**3.5** | Make efforts to educate your community |
Expand All @@ -43,17 +43,16 @@ This page serves as a guide for contributing as a project on Ergo. It outlines t

# | Description |
------- | ------------------------------------------------------------ |
**3.1** | Enable [OrgRobot](https://tgdev.io/bot/orgrobot) with custom questions |
**3.1** | Consider using [tgdev](https://tgdev.io/bot/orgrobot) which has a few handy free bots like [daysandbox_bot](https://tgdev.io/bot/daysandbox_bot) & [grep_robot](https://tgdev.io/bot/grep_robot) |
**3.2** | The built-in spam protection should be sufficient if properly configured |
**3.1** | Enable [OrgRobot](https://tgdev.io/bot/orgrobot) with custom questions which has a few handy free bots like [daysandbox_bot](https://tgdev.io/bot/daysandbox_bot), [grep_robot](https://tgdev.io/bot/grep_robot) and @WikiRobot, which can be used to reiterate a message at a set interval. |
**3.2** | The built-in spam protection should be sufficient if properly configured in `Server Settings -> Moderation -> Saftey Setup` make sure all protections are enabled. Under `Automod` you can define custom words to filter an example would be `.gd, .gg, @everyone, #Support, ✉️, ➡️, ➡, 🎟️, 👇, 👉, 🎁, 💌, 📨, 📩, 📪, 📭, 🆘, adminsupports, bch.gg, Create Ticket, dsc.gg, earn $, https://t.me, Open-Ticket, Raise a ticket, shrtm.nu, Support Ticket, supportservice`. Alternatively you can enable [Wickbot](https://wickbot.com/). |
**3.2** | The 'thread' permission is often abused by scammers, luring users into private threads where they imitate support staff, you should disable threads entirely if unused, otherwise disable them on a per-channel or role basis. |
**3.3** | Consider [bridging your chats](chat-bridge.md) with the Ergo Discord |
**3.3** | Get your Telegram added to [@ErgoChats](https://t.me/Ergo_Chats) on Telegram |
**3.3** | Create a PR to add yourself to this documentation |
**3.3** | Create a PR to add yourself to [this documentation](https://github.com/glasgowm148/ergodocs) |
**3.3** | Get added on [ergcube](https://ergcube.com/index.php?do=static&page=socials) and [sigmaverse](https://github.com/ergoplatform/sigmaverse) |
**3.4** | Participate in the weekly developer and marketing updates |
**3.4** | Participate in [ergoforum.org/c/marketing](https://www.ergoforum.org/c/marketing/13) |
**3.5** | Teach good principles like [KYA](kya.md) |
**3.5** | Warn users of scams being executed on the platform, particularly in response to support requests |
**3.5** | On Discord, disable threads as these are often used by scammers to imitate support tickets |
**3.5** | On Discord, use the built in automod feature to flag commonly mentioned spam and terms used by scammers. |


66 changes: 55 additions & 11 deletions docs/dev/Integration/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Major wallet functionalities include:
- Checking wallet balance (`/wallet/balances`) for all addresses
- Retrieving wallet transactions (`/wallet/transactions`) for all addresses

##### RPC Documention
##### RPC Documentation

- [Overview](https://docs.ergoplatform.com/node/swagger/)
- [API Spec](https://docs.ergoplatform.com/node/swagger/openapi/)
Expand Down Expand Up @@ -141,6 +141,17 @@ Use the `/wallet/deriveNextKey` API to generate new addresses in the same wallet
curl -X GET "http://localhost:9053/wallet/deriveNextKey" -H "accept: application/json" -H "api_key: hello"
```

The output would be:

```json
{
"derivationPath": "m/44'/429'/0'/0/1",
"address": "9gF9QP33MoPc8uekF95VHdosL4KzgSz7Ec7MLEtuhx4uPAd3eZs"
}
```

Derivation is done according to BIP-32.

### Address Validation

For exchanges, restrict withdrawals to P2PK addresses and invalidate other types. Supporting other types is not recommended. See [address](address.md) for more information on address types.
Expand All @@ -155,12 +166,37 @@ Get unspent UTXOs for an address using the `transactions/boxes/byAddress/unspent
https://api.ergoplatform.com/transactions/boxes/byAddress/unspent/9gAE5e454UT5s3NB1625u1LynQYPS2XzzBEK4xumvSZdqnXT35M
```

Exclude UTXOs spent in the mempool using the `/transactions/unconfirmed/byAddress` Explorer API method:
#### Handling Unconfirmed UTXOs

To avoid double-spending, it's important to handle unconfirmed UTXOs properly. There are two main approaches:

1. Fetch unconfirmed transactions using the `/transactions/unconfirmed/byErgoTree` endpoint and exclude inputs from these transactions. You can convert an address to ergoTree using the `ErgoAddress` class in fleetSDK:

```java
ErgoAddress.fromPublicKey(hex.decode(publicKey), Network.Mainnet).ergoTree;
```

2. Download the whole mempool using the `/transactions/unconfirmed` endpoint and exclude unconfirmed UTXOs from your inputs.

Here's an example of fetching unconfirmed transactions by ergoTree:

```bash
https://api.ergoplatform.com/transactions/unconfirmed/byAddress/9gAE5e454UT5s3NB1625u1LynQYPS2XzzBEK4xumvSZdqnXT35M
curl -X POST "https://api.ergoplatform.com/transactions/unconfirmed/byErgoTree" -H "Content-Type: application/json" -d "\"00020006f03234fca83e0f00e7fe45e4bdb9db03008f279f599273b471bd85e22d8f1ef01\""
```

If the result is an empty array, there are no unconfirmed transactions for the given ergoTree.

#### Batch Withdrawals

Processing user withdrawals in batches by gathering them in a script and pushing all outputs in one transaction can be beneficial. Here's a high-level overview of the process:

1. When a user initiates a withdrawal, store the transaction details in your system.
2. Every X minutes (e.g., 5-10 minutes), collect all pending withdrawals.
3. Build a new transaction with multiple inputs (from your exchange's wallet) and outputs (to the users' withdrawal addresses).
4. Sign and broadcast the batch transaction.

This approach can help optimize transaction processing and reduce overall fees. However, it may require adjustments to your existing code framework.

### Broadcasting Transactions

To broadcast a transaction made outside the node, serialize it into `JSON`. In Java:
Expand Down Expand Up @@ -188,12 +224,12 @@ Simple transactions should produce an explicit error when signing and/or broadca

> Failed to sign boxes due to Estimated execution cost 1001580 exceeds the limit 1000000: Vector(ErgoBox(0275eb3a125bc02fe997cb98c0de8131bd9b2e4617110d
This error can occur due to too many inputs collected in a transaction for dusty wallets.
This error can occur due to too many inputs collected in a transaction for [dusty wallets](#dust-collection).


https://docs.ergoplatform.com/dev/Integration/guide/#dust-collection

**Valid RBF transactions:**
Dropped transactions will be removed from the mempool, this can be checked with the /transactions/unconfirmed/{txId} endpoint
Dropped transactions will be removed from the mempool, this can be checked with the `/transactions/unconfirmed/{txId}` endpoint


### Dust Collection
Expand Down Expand Up @@ -258,6 +294,8 @@ This error can occur due to too many inputs collected in a transaction for dusty
Failed to sign boxes due to Estimated execution cost 1001580 exceeds the limit 1000000: Vector(ErgoBox(0275eb3a125bc02fe997cb98c0de8131bd9b2e4617110d
```
### Native Assets
For large airdrops, users may mistakenly put exchange addresses to receive native assets. An *auto-burn* method will be in future node versions to reduce manual effort. See this [Issue](https://github.com/ergoplatform/ergo/issues/1604) for more information.
Expand Down Expand Up @@ -293,9 +331,18 @@ Supporting other types isn't a problem if the user is aware of what they're doin
In appkit, `Address.create()` accepts an address string and returns an object from which you can obtain the ergoTree.
**Why do some transactions appear not to pay fees?**
**Transaction Fees**
Fees aren't mandatory in the core protocol, but transactions without them won't be propagated around the network by default.
Ergo's transaction fee system is designed to be flexible and explicit. Although the protocol does not enforce a specific minimum transaction fee, it employs a spam-prevention strategy that requires each box to contain a minimum amount of ERG based on its size. This minimum value is determined by a parameter voted on by miners.
As a guideline, it is suggested to allocate **0.001 ERG (1,000,000 NanoErg) for each box** involved in the transaction. Including a fee incentivizes miners to process your transaction more quickly.
Miners prioritize transactions based on either the fee per byte or the validation cost unit, which are adjustable via a voting mechanism among miners. Transaction fees are collected in a specific contract that can only be spent through a miner's script.
To determine the appropriate transaction fee, consider the protocol's minimum requirements based on the box size and the network's current hashrate. Higher hashrates reduce the risk of double-spend attacks, thus requiring fewer confirmations.
For more detailed information on transaction fees, including minimum values, miner prioritization, fee collection, and related topics, please refer to the dedicated [Transaction Fees](min-fee.md) page.
**What algorithm generates a boxid?**
Expand Down Expand Up @@ -344,6 +391,3 @@ Wallet nodes do not necessarily need to expose their ports, although you can do
Ergo does not require adding your node's IP to a whitelist for synchronization.
This comprehensive guide should provide exchanges and developers with the necessary information to integrate with the Ergo platform smoothly. It covers key features, infrastructure setup, wallet creation, troubleshooting, and addresses common concerns such as chain forking prevention, 51% attack mitigation, and storage rent. If you have any further questions or need assistance, please don't hesitate to reach out to the Ergo team or join the community discussions on Discord.
13 changes: 7 additions & 6 deletions docs/ef/ef-future.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
# The Ergo Foundation's Future

/// details | What's been done so far?
{type: info, open: true}
- For an overview of what has been achieved since launch, please see [this page](ergo-timeline.md)
- For a comprehensive overview of the scope of the Ergo Foundation see [this page](ef-scope.md)
///


## Initial Role of the Ergo Foundation
The Ergo Foundation's role was to bootstrap the Ergo ecosystem in the initial years and build up the infrastructure required for adoption, solving the 'hard side' of Ergo. This has led to the vibrant ecosystem we see today with:

### Achievements
- 300+ community developers
- 100+ active contributors in the weekly developer chat on Discord
- Hosting multiple [events](../events/index.md) per year
- 140+ projects developing on Ergo (see [sigmaverse.io](https://sigmaverse.io) for an overview)
- Consistently ranked in the top 100 for development activity on [artemis.xyz](https://app.artemis.xyz/developer-activity?ecosystemValue=Ergo)


/// details | What's been done so far?
{type: info, open: true}
- For an overview of what has been achieved since launch, please see [this page](ergo-timeline.md)
- For a comprehensive overview of the scope of the Ergo Foundation see [this page](ef-scope.md)
///

## The Future
As time goes on, the importance of the Ergo Foundation should diminish, and responsibility should shift towards the community. This is essential for both the strength and decentralization of the ecosystem.
Expand Down
16 changes: 8 additions & 8 deletions docs/ef/ef-treasury.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ For more information on the Ergo's emission schedule, tokenomics and allocation,

## Holdings

As of January 2024, the complete treasury of the foundation, including market making funds, is as follows:
As of March 2024, the complete treasury of the foundation, including market making funds, is as follows:


| Currency | Amount | Price | Total |
|-------|---------------|---|---|
| ERG | 481,122 | $1.60 | $769,795 |
| RSN | 30,000,000 | $0.102 | $3,060,000 |
| SPF | 28,500,000 | $0.0487 | $1,387,950 |
| BTC | 7.26 | $45,000 | $326,700 |
| USD | 92,495 | $1 | $92,495 |
| Gluon | 335,000 | N/A | |
| Total | | | **$5,636,940** |
| ERG | 482,053 | $1.88 | $906,261 |
| RSN | 30,000,000 | $0.1112 | $3,232,827 |
| SPF | 28,000,000 | $0.05367 | $1,497,890 |
| BTC | 7.26 | $71,404 | $518,393 |
| USD | 126,606 | $1 | $126,606 |
| Gluon | 335,000 | $1 | $335,000 |
| Total | | | **$6,616,977** |

/// details | How will the SPF/RSN and other tokens be utilized?
{type: question, open: true}
Expand Down
12 changes: 9 additions & 3 deletions docs/uses/sidechains/sigma-chains.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# Sigma Chains: The Future of Programmable Proof of Work on Ergo
---
tags:
- Sigma Chains
- Sigma Layer
---

This section introduces and explains Sigma Chains, a groundbreaking innovation designed to revitalize and expand the potential of Proof of Work (PoW) within the Ergo ecosystem. Sigma Chains represent a significant leap forward in making PoW cryptocurrencies more versatile, sustainable, and integral to decentralized finance (DeFi) applications.
# Sigma Chains: The Future of Programmable Proof of Work

This section introduces and explains Sigma Chains, a groundbreaking innovation designed to revitalize and expand the potential of Proof of Work (PoW). Sigma Chains represent a significant leap forward in making PoW cryptocurrencies more versatile, sustainable, and integral to decentralized finance (DeFi) applications.

## Introduction to Sigma Chains
Sigma Chains are a new series of blockchains backed by ASICs and empowered by Ergo's Sigma programming model. They aim to bring innovative functions, new options for existing miners, and support existing ASIC product lines while revitalizing Proof of Work.
Sigma Chains are a proposed new series of blockchains backed by ASICs and empowered by Ergo's Sigma programming model (the *'Sigma Layer'*). They aim to bring innovative functions, new options for existing miners, and support existing ASIC product lines while revitalizing Proof of Work.

### Key Features of Sigma Chains

Expand Down
7 changes: 4 additions & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,10 @@ nav:
- uses/sidechains.md
- Sub Blocks: uses/sidechains/subblocks.md
- Sigma Chains: uses/sidechains/sigma-chains.md
- ErgoData: uses/ErgoData.md
- SentientChain: uses/sentientchain.md
- PoUW: uses/pouw.md
- Archived:
- ErgoData: uses/ErgoData.md
- SentientChain: uses/sentientchain.md
- PoUW: uses/pouw.md
- Financial:
- Stablecoins:
- uses/stablecoins.md
Expand Down

0 comments on commit 3914d9a

Please sign in to comment.