# convert\_equivalent\_signature

根据 ECDSA 签名可延展性原理，生成另一个等效的签名。

## 方法定义

```python
@staticmethod
def convert_equivalent_signature(signature: HexBytes) -> Optional[SignatureData]:
```

## 参数说明

| 参数        | 类型       | 说明   |
| --------- | -------- | ---- |
| signature | HexBytes | 原始签名 |

## 返回值

返回 SignatureData 对象,包含以下字段:

| 字段        | 类型       | 说明     |
| --------- | -------- | ------ |
| signature | HexBytes | 完整签名   |
| r         | HexBytes | 签名 r 值 |
| s         | HexBytes | 签名 s 值 |
| v         | HexBytes | 签名 v 值 |

## 示例代码

```python
# 生成等效签名
original_signature = HexBytes("0x...")
equivalent_signature = Utils.convert_equivalent_signature(original_signature)

if equivalent_signature:
    print(f"Equivalent Signature: {equivalent_signature.signature.hex()}")
    print(f"r: {equivalent_signature.r.hex()}")
    print(f"s: {equivalent_signature.s.hex()}")
    print(f"v: {equivalent_signature.v.hex()}")
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://poseidon.seaeye.cn/evm/utils/convert_equivalent_signature.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
