Overview
CreditNexus provides blockchain-based notarization for documents and deals using smart contracts on the Base network. This enables immutable, multi-party signing with MetaMask integration and x402 payment processing. Code Reference:app/services/notarization_service.py, app/api/remote_routes.py, contracts/SecuritizationNotarization.solFrontend:
client/src/components/NotarizationModal.tsx
Key Features
Multi-Party Signing
- Required Signers: Define multiple required signers
- MetaMask Integration: Each signer signs with their MetaMask wallet
- Signature Verification: Ethereum signature verification
- Completion Tracking: Track signing progress
app/api/remote_routes.py (notarization endpoints)
Smart Contract Integration
- SecuritizationNotarization Contract: Smart contract on Base network
- Immutable Records: Blockchain-based transaction records
- Event Emission: Smart contract events for notarization
- Hash Verification: CDM payload hash verification
contracts/SecuritizationNotarization.sol
x402 Payment Integration
- Notarization Fees: Optional payment for notarization services
- USDC Payments: Payments in USDC stablecoin
- Payment Skipping: Admin users can skip payment requirement
- Payment Status: Track payment completion
app/services/x402_payment_service.py, client/src/components/NotarizationPayment.tsx
Workflow
1. Create Notarization Request
- Select Document/Deal: Choose document or deal to notarize
- Add Signers: Add required signer wallet addresses
- Configure Message: Set custom message prefix
- Create Request: Generate notarization record
- Payment: Process x402 payment (if required)
2. Sign Notarization
- Get Nonce: Retrieve signing nonce for wallet address
- Sign Message: Sign message with MetaMask
- Submit Signature: Submit signature to API
- Verification: System verifies Ethereum signature
- Completion: Check if all signers have signed
3. Complete Notarization
- All Signatures: All required signers have signed
- Blockchain Submission: Submit to smart contract (if enabled)
- CDM Event: Generate CDM notarization event
- Status Update: Update notarization status to “signed”
API Endpoints
Create Notarization
Create a notarization request for a deal. Request Body:app/api/remote_routes.py
Get Notarization Nonce
Get signing nonce for a wallet address. Query Parameters:wallet_address: Wallet address to get nonce for
Sign Notarization
Sign a notarization with MetaMask signature. Request Body:Smart Contract
SecuritizationNotarization Contract
Location:contracts/SecuritizationNotarization.sol
Functions:
createNotarization(): Create new notarization requestaddSignature(): Add signature to notarizationcompleteNotarization(): Complete notarization when all signers have signed
NotarizationCreated: Emitted when notarization is createdSignatureAdded: Emitted when signature is addedNotarizationCompleted: Emitted when notarization is completed
contracts/SecuritizationNotarization.sol
Configuration
Environment Variables
SecuritizationNotarization contract address (auto-deployed if empty)
Enable notarization fees. Default:
trueDefault notarization fee in USD. Default:
50.00Allow admin users to skip payment requirement. Default:
trueUser Interface
Notarization Modal
Location:client/src/components/NotarizationModal.tsx
Features:
- Signer Management: Add/remove required signers
- Wallet Connection: Connect MetaMask wallet
- Payment Processing: Handle x402 payment flow
- Status Display: Show signing progress
- Completion Handling: Handle notarization completion
CDM Event Integration
All notarizations generate CDM-compliant events:app/models/cdm_events.py (generate_cdm_securitization_notarization)
Security Considerations
- Signature Verification: All signatures verified using Ethereum signature verification
- Nonce Protection: Nonces prevent replay attacks
- Signer Validation: Only required signers can sign
- Hash Verification: CDM payload hash verified
- Blockchain Immutability: Once notarized, records are immutable
Best Practices
- Signer Selection: Choose appropriate signers for each notarization
- Message Clarity: Use clear, descriptive message prefixes
- Payment Handling: Process payments before notarization
- Status Monitoring: Monitor notarization status
- CDM Compliance: Ensure all notarizations generate CDM events
Troubleshooting
Signature Verification Fails
- Verify wallet address matches signer address
- Check message format matches exactly
- Verify signature format is correct
- Ensure nonce is current
Payment Not Processing
- Verify MetaMask is connected
- Check network is set to Base
- Verify USDC balance in wallet
- Check payment payload format
Additional Resources
Last Updated: 2026-01-14
Code Reference:
app/services/notarization_service.py, app/api/remote_routes.py, contracts/SecuritizationNotarization.sol