- BETH
- Concepts and reference
- SDK, API, and integration reference
SDK, API, and integration reference
Supported source libraries
Section titled “Supported source libraries”bitsafe-token-lib: Workflows and examples for BitSafe assets.canton-lib: shared Canton API clients, utilities, and the Token Standard operations thatbitsafe-token-libre-exports.
Pin approved release tags and keep their compatibility row together.
Integration layers
Section titled “Integration layers”| Layer | Use |
|---|---|
| Generated Canton clients | Authenticate, query contracts, submit commands, and read updates |
| BETH workflow functions | Balance, transfer, mint, redeem, account, and credential operations |
| BitSafe API client | Retrieve approved account rules and token-standard contracts |
| Ethereum bridge call | Build the depositETH transaction for a deposit |
| Examples | Executable references for supported tasks |
Recommended integration pattern
Section titled “Recommended integration pattern”- Load configuration through a typed layer.
- Create authenticated Canton and BitSafe API clients.
- Verify the party with a read-only query.
- Query current contracts and runtime rules.
- Validate the business request.
- Submit one command with a unique reference where supported.
- Read the authoritative result.
- Reconcile Canton, application, and Ethereum identifiers.
API reference policy
Section titled “API reference policy”Generated type and method documentation should remain in the repository or generated reference site. Public task guides should link to exact release documentation instead of copying full schemas.
Examples to preserve
Section titled “Examples to preserve”Balance checks, sending, incoming and outgoing offers, accepting or cancelling offers, credentials, minting, redemption, account inspection, batch transfers, and UTXO management.
Deposit event layout
Section titled “Deposit event layout”The mint::Deposit type in bitsafe-token-lib 0.6.0 uses this shared EVM event layout:
event Deposit( bytes32 indexed depositAccountIdHash, bytes depositAccountId, address indexed sender, uint256 amount, uint256 prevDepositBlock);prevDepositBlock identifies the previous deposit block for the same account. A zero value means no earlier deposit exists since deployment or the upgrade that adds this field. Two deposits for one account can share a block. The second then has prevDepositBlock equal to its own block number. The bridge view lastDepositBlock(bytes32 depositAccountIdHash) returns the block of the last deposit. The log filter must include the proxy address, topic0, and topic1 for the account. mint::deposit_id_topic computes topic1 from the deposit account ID. Read all matching logs in each block and use their lowest prevDepositBlock as the next link. The bridge’s deposit-link guide describes the complete walk. This view belongs to the bridge contract; the library provides no wrapper for it.
Callers that construct Deposit values must supply the new field.
mint::DEPOSIT_EVENT_TOPIC now matches only the five-field event:
0xf3ca88974ec5963addc617fe6c0c359d7196759e318be6ab0cade940986e30e2Callers that scan historical deposits must also filter on the old topic:
0xacaea730ea841fae3326f72a7ff746b6e06c646840526bcaf5dabee5fd887ef8Declare the old four-field layout in a separate sol! block to decode those logs. The new Deposit decoder rejects logs with the old topic. Decoding old data without checking the topic can silently produce an incorrect prevDepositBlock value. The library provides one event binding; callers select the decoder by the log topic. Check the bridge ABI for the deployment and block range that you query.
Technical sources
Section titled “Technical sources”- Shared EVM event binding at
v0.6.0 bitsafe-token-libexamples guide atv0.6.0- Ethereum bridge contract
Related pages
Section titled “Related pages”- BETH developer Quick Start
- BETH authentication
- Transfer and receive BETH
- Mint BETH
- Redeem BETH
- BETH errors, retries, and troubleshooting
- BETH compatibility and release notes
Next step
Section titled “Next step”Validate the integration: BETH developer Quick Start.
Ask the docs
Answers come only from this documentation and can be wrong. Check the linked pages.
Ask a question about BitSafe, CBTC or the developer guides. For example: