Update notes

This commit is contained in:
Fuma Nama
2026-01-01 01:22:27 +00:00
parent 74d39e7383
commit cb077a019d
2 changed files with 10 additions and 10 deletions
+7 -7
View File
@@ -181,32 +181,32 @@ interface IFHEDecrypt {
/// @param handle The encrypted value handle
/// @param ctType The ciphertext type
/// @return requestId The decryption request ID
function requestDecryption(bytes32 handle, uint8 ctType) external returns (bytes32 requestId);
function decrypt(bytes32 handle, uint8 ctType) external returns (bytes32 requestId);
/// @notice Request decryption with callback
/// @param handle The encrypted value handle
/// @param ctType The ciphertext type
/// @param callback Contract to call when decryption completes
/// @param callbackSelector Function selector to call
function requestDecryptionWithCallback(
function decryptAndCall(
bytes32 handle,
uint8 ctType,
address callback,
bytes4 callbackSelector
) external returns (bytes32 requestId);
/// @notice Get decryption result (poll-based)
/// @notice Get decryption result (poll-based) - use reveal() in FHE library
/// @param requestId The decryption request ID
/// @return result The decrypted value (if ready)
/// @return ready Whether the result is available
function getDecryptResult(bytes32 requestId) external view returns (bytes memory result, bool ready);
function reveal(bytes32 requestId) external view returns (bytes memory result, bool ready);
/// @notice Fulfill a decryption request (called by T-Chain relayer)
/// @param requestId The request ID
/// @param result The decrypted plaintext value
function fulfillDecryption(bytes32 requestId, bytes calldata result) external;
function fulfill(bytes32 requestId, bytes calldata result) external;
// Events
event DecryptionRequested(bytes32 indexed requestId, bytes32 indexed handle, uint8 ctType, address requester);
event DecryptionFulfilled(bytes32 indexed requestId, bytes result);
event Decrypted(bytes32 indexed requestId, bytes32 indexed handle, uint8 ctType, address requester);
event Revealed(bytes32 indexed requestId, bytes result);
}
+3 -3
View File
@@ -150,12 +150,12 @@ contract PrivateBalance {
## Decryption Flow
1. **Request**: Contract calls `Gateway.requestDecryption(handle, type)`
1. **Request**: Contract calls `FHE.decrypt(value)` or `Gateway.decrypt(handle, type)`
2. **Warp**: Request sent to T-Chain via Warp messaging
3. **Threshold**: 67-of-100 validators contribute decryption shares
4. **Combine**: Shares combined to recover plaintext
5. **Fulfill**: Result returned via `fulfillDecryption` callback
6. **Poll/Callback**: Contract retrieves result or receives callback
5. **Fulfill**: Result returned via `fulfill(requestId, result)` callback
6. **Poll/Callback**: Contract retrieves result via `reveal(requestId)` or receives callback
## Files