Bitcoin Forum
September 29, 2025, 07:22:54 PM *
News: Latest Bitcoin Core release: 29.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Alternate cryptocurrencies / Announcements (Altcoins) / EquaHash Core | [VRF-PoW] [ASIC-resistant] [Mobile-first] A novel proof-of-work on: June 18, 2025, 01:06:48 AM
Comments welcome
https://github.com/gs522084/equahash-core
🎲Fair mining based on VRF: Candidates are selected by P = sqrt(hashrate)/∑sqrt(H_global)
⚡Improved version of RandomX: Forced single-thread optimization, measured mobile CPU efficiency 0.8 H/s
⚖️Three-level reward model: 70% block reward + 20% small mining pool + 10% community fund
📱Zero trust light node: PoW verification based on WASM, traffic <1MB/day

# Developer Quick Start
git clone https://github.com/equahash/equahash-core.git
cd equahash-core && make testnet

Core modules:

consensus/ - VRF+Slashing implementation

miner/ - Adaptive power consumption mining algorithm

specs/ - White paper and economic model formula


### **Second, community-friendly version (for ordinary users)**
```markdown
**🌍 EquaHash: A blockchain that allows mobile phones to mine fairly**

We are solving the core problems in the PoW field:
- ❌ **Hash power monopoly** → Suppress large miners through VRF randomization + hash power square root
- 📱 **High participation threshold** → Android/iOS devices can mine, daily average power consumption <5%
- 💰 **Reward centralization** → Unique small miner protection pool (20% reward allocated to ordinary users)

**Why contribute? **
- 🏆 Get EQH token rewards (Gitcoin bounty is open)
- 🛠️ Participate in projects that change the history of cryptocurrency
- 📈 Your code will be run by millions of mobile devices

```diff
! Urgent contributions are needed:
+ Rust developers (optimize VRF module)
+ Mobile engineers (power saving algorithm)
+ Multi-language document translation
------------------------------------------------------------------
---

### **Three, key elements disassembly**

1. **Technical keywords front **

- Use tags such as `[VRF-PoW]`, `[ASIC-Resistant]` to facilitate SEO search

- Direct display of core algorithm formulas (reflecting mathematical rigor)

2. **Pain point solutions**

- Comparison of traditional PoW problems → EQH's innovative solutions

- Example:

```markdown

## 🔧 Traditional problems vs EQH solutions

| Problems | Our solutions |

|---------------------|-------------------------------|

| ASIC monopoly computing power | Single-threaded optimized RandomX improved version |

| Mobile phones cannot participate | WASM light node + dynamic power consumption control |
## 🚀 Take action now

1. Star this repository (get update notifications)

2. Check out [Good First Issues](https://github.com/xxx/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)
3. Join [Discord discussion](https://discord.gg/xxx)
## 📊 Comparison of computing power distribution (simulated data)
Bitcoin |██████████░░░░| 65% top10% miners
EQH |██████░░░░░░░░| 41% top10% miners

--------------------------------------------------------------
### Technological breakthroughs
- 🧩 **Molecular proof mechanism**: PoW + VRF + Slashing trinity
- 📉 **ASIC invalidation**: GPU efficiency is 30% lower than mobile phone CPU ([test report](benchmarks/2023-09.md))
- ⏳ **Delayed fairness**: Small miners' block delay compensation algorithm
2  Alternate cryptocurrencies / Announcements (Altcoins) / White Paper: Research on Intergenerational Wealth Dynamic Distribution System Ba on: June 02, 2025, 12:57:05 AM
Code:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

/**
 * @title 代际财富管理系统 - 完整版
 * @notice 实现22年首代注册、生育控制、赡养义务与跨代继承
 */
contract GenerationalWealth {
    // ======================
    // 1. 常量定义
    // ======================
    uint256 private constant SECONDS_PER_YEAR = 31536000;
    uint256 public constant GENESIS_PERIOD = 22 * SECONDS_PER_YEAR;
    uint256 public constant FERTILITY_WINDOW = 20 * SECONDS_PER_YEAR;
    uint256 public constant LIFESPAN = 100 * SECONDS_PER_YEAR;
    uint256 public constant SUPPORT_INTERVAL = 30 days;
    uint256 public constant SUPPORT_RATE = 5; // 5%
    uint256 public constant MAX_CHILDREN = 3;

    // ======================
    // 2. 数据结构
    // ======================
    struct Person {
        uint256 birthTime;
        address[2] parents;
        address[] children;
        address spouse;
        uint256 fertilityEnd;
        uint256 lastSupportPaid;
    }

    // ======================
    // 3. 存储变量
    // ======================
    mapping(address => Person) public people;
    address[] public population;
    uint256 public immutable genesisEndTime;

    // ======================
    // 4. 事件定义
    // ======================
    event Registered(address indexed who);
    event Married(address indexed partner1, address indexed partner2);
    event ChildBorn(address indexed parent1, address indexed parent2, address child);
    event SupportPaid(address indexed from, address indexed to, uint256 amount);
    event Inherited(address indexed from, address[] heirs, uint256[] amounts);

    // ======================
    // 5. 构造函数
    // ======================
    constructor() {
        genesisEndTime = block.timestamp + GENESIS_PERIOD;
    }

    // ======================
    // 6. 外部函数
    // ======================

    /**
     * @dev 首代注册(前22年有效)
     */
    function register() external {
        require(block.timestamp < genesisEndTime, "GENESIS_PERIOD_ENDED");
        require(people[msg.sender].birthTime == 0, "ALREADY_REGISTERED");

        people[msg.sender] = Person({
            birthTime: block.timestamp,
            parents: [address(0), address(0)],
            children: new address[](0),
            spouse: address(0),
            fertilityEnd: block.timestamp + FERTILITY_WINDOW,
            lastSupportPaid: 0
        });
        population.push(msg.sender);
        
        emit Registered(msg.sender);
    }

    /**
     * @dev 创建家庭并生育子代
     * @param partner 配偶地址
     */
    function createFamily(address partner) external returns (address child) {
        require(block.timestamp >= genesisEndTime, "GENESIS_PERIOD_ACTIVE");
        require(msg.sender != partner, "SELF_MARRIAGE");
        require(people[msg.sender].spouse == address(0), "ALREADY_MARRIED");
        require(people[partner].spouse == address(0), "PARTNER_MARRIED");
        require(people[msg.sender].children.length < MAX_CHILDREN, "CHILD_LIMIT");
        require(block.timestamp < people[msg.sender].fertilityEnd, "FERTILITY_ENDED");

        // 使用CREATE2生成确定性子地址
        bytes memory creationCode = abi.encodePacked(
            type(ChildProxy).creationCode,
            abi.encode(msg.sender, partner, address(this))
        );
        bytes32 salt = keccak256(abi.encodePacked(
            msg.sender,
            partner,
            people[msg.sender].children.length
        ));
        assembly {
            child := create2(0, add(creationCode, 0x20), mload(creationCode), salt)
        }

        // 注册子代
        _registerChild(msg.sender, partner, child);

        emit Married(msg.sender, partner);
        emit ChildBorn(msg.sender, partner, child);
    }

    /**
     * @dev 执行赡养费支付(需定期调用)
     */
    function executeSupport() external {
        for (uint256 i = 0; i < population.length; i++) {
            address person = population[i];
            if (_shouldPaySupport(person)) {
                _paySupport(person);
            }
        }
    }

    /**
     * @dev 执行遗产分配(需定期调用)
     */
    function executeInheritance() external {
        for (uint256 i = 0; i < population.length; i++) {
            address person = population[i];
            if (_shouldInherit(person)) {
                _distributeInheritance(person);
            }
        }
    }

    // ======================
    // 7. 公开查询函数
    // ======================

    /**
     * @dev 获取地址年龄
     */
    function getAge(address who) public view returns (uint256) {
        return (block.timestamp - people[who].birthTime) / SECONDS_PER_YEAR;
    }

    // ======================
    // 8. 内部函数
    // ======================

    /**
     * @dev 注册子代(供ChildProxy调用)
     */
    function _registerChild(address parent1, address parent2, address child) internal {
        people[parent1].spouse = parent2;
        people[parent2].spouse = parent1;
        people[parent1].children.push(child);
        people[parent2].children.push(child);
        
        people[child] = Person({
            birthTime: block.timestamp,
            parents: [parent1, parent2],
            children: new address[](0),
            spouse: address(0),
            fertilityEnd: block.timestamp + FERTILITY_WINDOW,
            lastSupportPaid: 0
        });
        population.push(child);
    }

    function _shouldPaySupport(address who) internal view returns (bool) {
        Person storage p = people[who];
        return getAge(who) >= 40 &&
               (p.parents[0] != address(0) || p.parents[1] != address(0)) &&
               block.timestamp >= p.lastSupportPaid + SUPPORT_INTERVAL &&
               address(who).balance > 0;
    }

    function _paySupport(address payer) internal {
        Person storage p = people[payer];
        uint256 paymentAmount = address(payer).balance * SUPPORT_RATE / 100;
        
        for (uint256 i = 0; i < 2; i++) {
            if (p.parents[i] != address(0)) {
                (bool sent, ) = p.parents[i].call{value: paymentAmount / 2}("");
                require(sent, "PAYMENT_FAILED");
                p.lastSupportPaid = block.timestamp;
                emit SupportPaid(payer, p.parents[i], paymentAmount / 2);
            }
        }
    }

    function _shouldInherit(address who) internal view returns (bool) {
        return getAge(who) >= 100 &&
               people[who].children.length > 0 &&
               address(who).balance > 0;
    }

    function _distributeInheritance(address deceased) internal {
        Person storage p = people[deceased];
        uint256 totalEstate = address(deceased).balance;
        
        // 计算分配比例
        uint256 childrenShare = totalEstate * 80 / 100;
        uint256 grandchildrenShare = totalEstate - childrenShare;
        
        // 准备受益人数组
        address[] memory heirs = new address[](p.children.length + _countGrandchildren(deceased));
        uint256[] memory amounts = new uint256[](heirs.length);
        uint256 heirIndex = 0;

        // 分配给子女(80%平分)
        uint256 perChild = childrenShare / p.children.length;
        for (uint256 i = 0; i < p.children.length; i++) {
            heirs[heirIndex] = p.children[i];
            amounts[heirIndex] = perChild;
            heirIndex++;
            (bool sent, ) = p.children[i].call{value: perChild}("");
            require(sent, "TRANSFER_FAILED");
        }

        // 分配给孙辈(20%平分)
        if (grandchildrenShare > 0) {
            uint256 totalGrandchildren = _countGrandchildren(deceased);
            if (totalGrandchildren > 0) {
                uint256 perGrandchild = grandchildrenShare / totalGrandchildren;
                for (uint256 i = 0; i < p.children.length; i++) {
                    address child = p.children[i];
                    for (uint256 j = 0; j < people[child].children.length; j++) {
                        heirs[heirIndex] = people[child].children[j];
                        amounts[heirIndex] = perGrandchild;
                        heirIndex++;
                        (bool sent, ) = people[child].children[j].call{value: perGrandchild}("");
                        require(sent, "TRANSFER_FAILED");
                    }
                }
            }
        }

        emit Inherited(deceased, heirs, amounts);
    }

    function _countGrandchildren(address grandparent) internal view returns (uint256) {
        uint256 count;
        Person storage gp = people[grandparent];
        for (uint256 i = 0; i < gp.children.length; i++) {
            count += people[gp.children[i]].children.length;
        }
        return count;
    }

    // ======================
    // 9. 回退函数
    // ======================
    receive() external payable {}
}

/**
 * @title 子地址代理合约
 * @dev 通过汇编代码实现确定性子地址生成
 */
contract ChildProxy {
    constructor(address parent1, address parent2, address wealthContract) {
        // 安全调用主合约
        (bool success, ) = wealthContract.call(
            abi.encodeWithSignature(
                "_registerChild(address,address,address)",
                parent1,
                parent2,
                address(this)
            )
        );
        require(success, "REGISTRATION_FAILED");
    }
}
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!