Signing ======= Using different signing methods ------------------------------- By default, an :ref:`Account` uses the signing method of OpenZeppelin's account contract. If for any reason you want to use a different signing algorithm, it is possible to create ``Account`` with custom :ref:`Signer` implementation. .. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_custom_signer.py :language: python :dedent: 4 Signing with Ledger ------------------- :ref:`LedgerSigner` allows you to sign transactions using a Ledger device. The device must be unlocked and Starknet app needs to be open. Currently used version of Starknet app is ``1.1.1`` and only blind-signing is possible. Clear-signing will be available in the near future. .. codesnippet:: ../../starknet_py/tests/unit/signer/test_ledger_signer.py :language: python :dedent: 4 Deploying account and transferring STRK --------------------------------------- .. codesnippet:: ../../starknet_py/tests/unit/signer/test_ledger_signer.py :language: python :dedent: 4 :start-after: docs-deploy-account-and-transfer: start :end-before: docs-deploy-account-and-transfer: end Signing off-chain messages ------------------------------- :ref:`Account` lets you sign an off-chain message by using encoding standard proposed `here `_. You can also **verify a message**, which is done by a call to ``is_valid_signature`` endpoint in the account's contract (e.g. `OpenZeppelin's account contract `_). .. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_sign_offchain_message.py :language: python :dedent: 4 Signing for fee estimation -------------------------- :ref:`Account` allows signing transactions for the purpose of fee estimation. Transactions signed for fee estimation use a transaction version that makes them non-executable on Starknet. If a transaction like this was to be intercepted in transport, it could not be executed without the user consent. .. attention:: Conventionally signed transactions can still be used to estimate fee. They however don't offer the extra security of signing specifically for the purpose of fee estimation. When manually estimating fee for transactions, always prefer estimation specific signing. .. codesnippet:: ../../starknet_py/tests/e2e/docs/guide/test_sign_for_fee_estimate.py :language: python :dedent: 4